Commit 442b983
committed
Fix stuck UI after unapply failure
When `stackService.unapply()` fails, the UI gets stuck — context menus
stay open and stale stacks remain visible because the cleanup code
only ran on the success path.
In `BranchHeaderContextMenu.svelte`, `close()` was called sequentially
after `await unapply()`, and in `StackDragHandle.svelte`,
`stacksQuery.result.refetch()` was likewise awaited after the call.
An error in either case meant cleanup never executed.
Wrapped both call sites in `try/finally` so cleanup always runs
regardless of whether the backend call succeeds or fails.1 parent 035825c commit 442b983
2 files changed
Lines changed: 15 additions & 9 deletions
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
346 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
0 commit comments