Browse Source

fix: add action to set project value

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5274/head
Pranav C 2 years ago
parent
commit
618c069db3
  1. 1
      packages/nc-gui/composables/useMultiSelect/index.ts
  2. 8
      packages/nc-gui/composables/useSharedFormViewStore.ts
  3. 5
      packages/nc-gui/store/project.ts

1
packages/nc-gui/composables/useMultiSelect/index.ts

@ -14,7 +14,6 @@ import {
message,
reactive,
ref,
storeToRefs,
unref,
useCopy,
useEventListener,

8
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 }

5
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,
}
})

Loading…
Cancel
Save