From c1a86f0808ea2d2b6de7ecdd12f389491da0a5a3 Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 29 Dec 2022 23:22:04 +0300 Subject: [PATCH] fix: use ref for forcedProjectId Signed-off-by: mertmit --- packages/nc-gui/composables/useProject.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useProject.ts b/packages/nc-gui/composables/useProject.ts index 5f97cc7434..d9257aa20d 100644 --- a/packages/nc-gui/composables/useProject.ts +++ b/packages/nc-gui/composables/useProject.ts @@ -42,9 +42,9 @@ const [setup, use] = useInjectionState(() => { const lastOpenedViewMap = ref>({}) - let forcedProjectId: string | undefined + const forcedProjectId = ref() - const projectId = computed(() => forcedProjectId || (route.params.projectId as string)) + const projectId = computed(() => forcedProjectId.value || (route.params.projectId as string)) // todo: refactor path param name and variable name const projectType = $computed(() => route.params.projectType as string) @@ -107,7 +107,7 @@ const [setup, use] = useInjectionState(() => { } async function loadProject(withTheme = true, forcedId?: string) { - if (forcedId) forcedProjectId = forcedId + if (forcedId) forcedProjectId.value = forcedId if (projectType === 'base') { try { const baseData = await api.public.sharedBaseGet(route.params.projectId as string)