File tree Expand file tree Collapse file tree
apps/desktop/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 342342 testId ={TestId .BranchHeaderContextMenu_UnapplyBranch }
343343 disabled ={isReadOnly }
344344 onclick ={async () => {
345- await stackService .unapply ({ projectId , stackId });
346- close ();
345+ try {
346+ await stackService .unapply ({ projectId , stackId });
347+ } finally {
348+ close ();
349+ }
347350 }}
348351 />
349352 </ContextMenuSection >
Original file line number Diff line number Diff line change 8888 async function unapplyStack() {
8989 if (! stackId ) return ;
9090
91- await stackService .unapply ({
92- projectId ,
93- stackId ,
94- });
95-
96- // Refetch to update the UI
97- await stacksQuery .result .refetch ();
91+ try {
92+ await stackService .unapply ({
93+ projectId ,
94+ stackId ,
95+ });
96+ } finally {
97+ // Always refetch to clear stale stacks from the UI,
98+ // even if the unapply failed (e.g. branch already removed).
99+ await stacksQuery .result .refetch ();
100+ }
98101 }
99102 </script >
100103
You can’t perform that action at this time.
0 commit comments