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

Function lastProjectKey

frontend/src/react/stores/sqlEditor/editor.ts:62–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60// at call time; if it isn't hydrated yet the scope falls back to "" and the
61// project is re-resolved from the route anyway.
62const lastProjectKey = () => {
63 const state = useAppStore.getState();
64 // Defensive: this runs at module-init (store may be pre-hydration) and the
65 // app store is mocked in some tests, so isSaaSMode may be absent. Default to
66 // the unscoped (self-host) key in that case.
67 const isSaaS =
68 typeof state?.isSaaSMode === "function" ? state.isSaaSMode() : false;
69 return storageKeySqlEditorLastProject(
70 workspaceCacheScope(isSaaS, state?.currentUser?.workspace ?? "")
71 );
72};
73
74const readProject = () =>
75 safeRead<string>(

Callers 2

readProjectFunction · 0.85
setProjectFunction · 0.85

Calls 2

workspaceCacheScopeFunction · 0.90

Tested by

no test coverage detected