Commit 98c2743
authored
🤖 fix: prevent stale redirect after workspace deletion (#1001)
When deleting a workspace, the redirect logic was using a stale closure
value of `selectedWorkspace`. If the user navigated to another workspace
while the delete was in progress, they'd still get redirected to the
project page because the callback captured the old selection.
**Fix:** Use functional update form of `setSelectedWorkspace` to check
the *current* selection at the time the delete completes, not the value
captured when the callback was created.
_Generated with `mux`_1 parent 1cecc36 commit 98c2743
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | | - | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
| |||
0 commit comments