Commit 5d7916c
Drill into TAB_NAVIGATOR in session storage fallback for workspace restore
The session-storage fallback in useRestoreWorkspacesTabOnNavigate searched
for WORKSPACE_NAVIGATOR at the root level of the state from getStateFromPath,
but getStateFromPath returns state rooted at TAB_NAVIGATOR. This caused the
findLast to never find WORKSPACE_NAVIGATOR, falling through to the workspaces
list instead of restoring the last workspace sub-page after a refresh.
Updated the test mock to match the real getStateFromPath output shape.
Co-authored-by: Sobit Neupane <sobitneupane@users.noreply.github.com>1 parent 8f67bd6 commit 5d7916c
2 files changed
Lines changed: 15 additions & 6 deletions
File tree
- src/hooks
- tests/unit/hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
| 287 | + | |
288 | 288 | | |
289 | | - | |
290 | 289 | | |
291 | | - | |
292 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
293 | 300 | | |
294 | 301 | | |
295 | 302 | | |
| |||
0 commit comments