Browse Source

fix: extract default view if view id missing in path

pull/7023/head
Pranav C 8 months ago
parent
commit
6b0047c797
  1. 7
      packages/nc-gui/store/views.ts

7
packages/nc-gui/store/views.ts

@ -54,7 +54,12 @@ export const useViewsStore = defineStore('viewsStore', () => {
const { activeTable } = storeToRefs(useTablesStore())
const activeViewTitleOrId = computed(() => {
if (!route.value.params.viewTitle?.length) return views.value.length ? views.value[0].id : undefined
if (!route.value.params.viewTitle?.length) {
// find the default view and navigate to it, if not found navigate to the first one
const defaultView = views.value?.find((v) => v.is_default) || views.value?.[0]
return defaultView?.id
}
return route.value.params.viewTitle
})

Loading…
Cancel
Save