()
| 122 | Array.isArray(v); |
| 123 | |
| 124 | const currentScope = (): { |
| 125 | wsScope: string; |
| 126 | project: string; |
| 127 | email: string; |
| 128 | } | null => { |
| 129 | const project = getSQLEditorEditorState().project; |
| 130 | if (!project) return null; |
| 131 | // The current user is loaded into the app store during tab hydration |
| 132 | // (see hydrateProjectTabs), so it's available by the time tabs are |
| 133 | // persisted on user actions. |
| 134 | const state = useAppStore.getState(); |
| 135 | const email = state.currentUser?.email ?? ""; |
| 136 | const wsScope = workspaceCacheScope( |
| 137 | state.isSaaSMode(), |
| 138 | state.currentUser?.workspace ?? "" |
| 139 | ); |
| 140 | return { wsScope, project, email }; |
| 141 | }; |
| 142 | |
| 143 | const persistOpenTabs = (openTabs: PersistentTab[]) => { |
| 144 | const scope = currentScope(); |
no test coverage detected