MCPcopy Index your code
hub / github.com/bytebase/bytebase / currentScope

Function currentScope

frontend/src/react/stores/sqlEditor/tab.ts:124–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 Array.isArray(v);
123
124const 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
143const persistOpenTabs = (openTabs: PersistentTab[]) => {
144 const scope = currentScope();

Callers 2

persistOpenTabsFunction · 0.70
persistCurrentTabIdFunction · 0.70

Calls 2

getSQLEditorEditorStateFunction · 0.90
workspaceCacheScopeFunction · 0.90

Tested by

no test coverage detected