From 296309d2916999e213649d3b02e27f208bc242be Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 1 Aug 2022 19:44:10 +0530 Subject: [PATCH] refactor(gui-v2): remove unused import, rename variable Signed-off-by: Pranav C --- .../nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue | 3 --- .../nc-gui-v2/components/smartsheet/sidebar/index.vue | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) 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 },