diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue index 1ae65d9a32..b46f845417 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue @@ -6,11 +6,8 @@ import { notification } from 'ant-design-vue' import type { Ref } from 'vue' import Sortable from 'sortablejs' import RenameableMenuItem from './RenameableMenuItem.vue' -import { Meta } from '#head/components' import { inject, onMounted, ref, useApi, useTabs, watch } from '#imports' import { extractSdkResponseErrorMsg } from '~/utils' -import type { TabItem } from '~/composables/useTabs' -import { TabType } from '~/composables/useTabs' import { ActiveViewInj, MetaInj, ViewListInj } from '~/context' interface Emits { diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/index.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/index.vue index 615866dc9f..e4e800d936 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/index.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/index.vue @@ -37,16 +37,16 @@ let modalOpen = $ref(false) /** Watch route param and change active view based on `viewTitle` */ watch( [views, () => route.params.viewTitle], - ([views, viewTitle]) => { + ([nextViews, viewTitle]) => { if (viewTitle) { - const view = views.find((v) => v.title === viewTitle) + const view = nextViews.find((v) => v.title === viewTitle) if (view) { activeView.value = view } } /** if active view is not found, set it to first view */ - if (!activeView.value && views.length) { - activeView.value = views[0] + if (!activeView.value && nextViews.length) { + activeView.value = nextViews[0] } }, { immediate: true },