diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 2c816e88ef..507cd81f63 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -14,7 +14,6 @@ import { message, reactive, ref, - storeToRefs, unref, useCopy, useEventListener, diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index f302d17bce..cef09add04 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/packages/nc-gui/composables/useSharedFormViewStore.ts @@ -17,6 +17,7 @@ import { useI18n, useInjectionState, useMetas, + useProject, useProvideSmartsheetRowStore, watch, } from '#imports' @@ -44,7 +45,8 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share const { metas, setMeta } = useMetas() - const { project } = storeToRefs(useProject) + const projectStore = useProject() + const { project } = storeToRefs(projectStore) const { t } = useI18n() @@ -89,14 +91,14 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share // if project is not defined then set it with an object containing base if (!project.value?.bases) - project.value = { + projectStore.setProject({ bases: [ { id: viewMeta.base_id, type: viewMeta.client, }, ], - } + }) const relatedMetas = { ...viewMeta.relatedMetas } diff --git a/packages/nc-gui/store/project.ts b/packages/nc-gui/store/project.ts index bfb2336dfd..ab32d6831f 100644 --- a/packages/nc-gui/store/project.ts +++ b/packages/nc-gui/store/project.ts @@ -186,6 +186,10 @@ export const useProject = defineStore('projectStore', () => { setTheme() } + const setProject = (projectVal: ProjectType) => { + project.value = projectVal + } + watch( () => route.params.projectType, (n) => { @@ -217,5 +221,6 @@ export const useProject = defineStore('projectStore', () => { lastOpenedViewMap, isXcdbBase, hasEmptyOrNullFilters, + setProject, } })