Commit 97996b2
committed
fix: add workspace to store synchronously before switching
When creating a workspace with async background operations, the
frontend can try to access the workspace before React processes
the state update. This causes a race condition where WorkspaceStore
throws 'must call addWorkspace() first'.
Fix by calling workspaceStore.addWorkspace() synchronously BEFORE
setting the selected workspace. This ensures the store knows about
the workspace immediately, regardless of when React batches the
state updates.1 parent 2272df4 commit 97996b2
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
| |||
0 commit comments