From 852d3e017b6bb7bed8b38b94293fb6c578b08ba6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 13 Aug 2022 11:23:23 +0530 Subject: [PATCH] chore(gui-v2): lint Signed-off-by: Pranav C --- packages/nc-gui-v2/composables/useMetas.ts | 1 + packages/nc-gui-v2/composables/useProject.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/composables/useMetas.ts b/packages/nc-gui-v2/composables/useMetas.ts index b67534d84a..732f5393fe 100644 --- a/packages/nc-gui-v2/composables/useMetas.ts +++ b/packages/nc-gui-v2/composables/useMetas.ts @@ -13,6 +13,7 @@ export function useMetas() { const loadingState = useState>('metas-loading-state', () => ({})) const getMeta = async (tableIdOrTitle: string, force = false): Promise => { + if (!tableIdOrTitle) return null /** wait until loading is finished if requesting same meta */ if (!force && loadingState.value[tableIdOrTitle]) { await new Promise((resolve) => { diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index 990325e791..f11e5a1124 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -13,6 +13,7 @@ export function useProject(projectId?: MaybeRef) { const tables = useState('tables', () => [] as TableType[]) const route = useRoute() + // todo: refactor path param name and variable name const projectType = $computed(() => route.params.projectType as string) async function loadProjectRoles() { @@ -52,6 +53,7 @@ export function useProject(projectId?: MaybeRef) { const sqlUi = computed( () => SqlUiFactory.create({ client: projectBaseType }) as Exclude, typeof OracleUi>, ) + const isSharedBase = computed(() => projectType === 'base') - return { project, tables, loadProjectRoles, loadProject, loadTables, isMysql, isPg, sqlUi } + return { project, tables, loadProjectRoles, loadProject, loadTables, isMysql, isPg, sqlUi, isSharedBase } }