Browse Source

fix: undefined watchers

pull/6647/head
mertmit 9 months ago
parent
commit
3daee4f886
  1. 6
      packages/nc-gui/store/config.ts

6
packages/nc-gui/store/config.ts

@ -7,7 +7,9 @@ export const useConfigStore = defineStore('configStore', () => {
const sidebarStore = useSidebarStore()
const viewsStore = useViewsStore()
const { activeViewTitleOrId } = storeToRefs(viewsStore)
const tablesStore = useTablesStore()
const { activeTableId } = storeToRefs(tablesStore)
const isViewPortMobile = () => width.value < MAX_WIDTH_FOR_MOBILE_MODE
@ -47,7 +49,7 @@ export const useConfigStore = defineStore('configStore', () => {
const handleSidebarOpenOnMobileForNonViews = () => {
if (!isViewPortMobile()) return
if (!viewsStore.activeViewTitleOrId && !tablesStore.activeTableId) {
if (!activeViewTitleOrId && !activeTableId) {
nextTick(() => {
sidebarStore.isLeftSidebarOpen = true
})
@ -56,7 +58,7 @@ export const useConfigStore = defineStore('configStore', () => {
}
}
watch([viewsStore.activeViewTitleOrId, tablesStore.activeTableId], () => {
watch([activeViewTitleOrId, activeTableId], () => {
handleSidebarOpenOnMobileForNonViews()
})

Loading…
Cancel
Save