( store: ReturnType<typeof useAppStore.getState> )
| 98 | // `loadWorkspaceProfile()` is awaited before the router mounts (see main.ts), |
| 99 | // so `appFeatures` is populated by the time this runs. |
| 100 | function resolveRootRedirect( |
| 101 | store: ReturnType<typeof useAppStore.getState> |
| 102 | ): string { |
| 103 | if ( |
| 104 | store.appFeatures["bb.feature.database-change-mode"] === |
| 105 | DatabaseChangeMode.EDITOR |
| 106 | ) { |
| 107 | return resolvePath(SQL_EDITOR_HOME_MODULE); |
| 108 | } |
| 109 | const lastVisit = readLastVisit(store); |
| 110 | if (lastVisit && isMeaningfulVisit(lastVisit)) { |
| 111 | return lastVisit; |
| 112 | } |
| 113 | return resolvePath(WORKSPACE_ROUTE_LANDING); |
| 114 | } |
| 115 | |
| 116 | // Read the most-recent visited path from the per-user recent-visit list in |
| 117 | // localStorage (same scoped key + JSON format as `useRecentVisit`). |
no test coverage detected