Browse Source

refactor(gui-v2): remove unused import, rename variable

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2934/head
Pranav C 2 years ago
parent
commit
296309d291
  1. 3
      packages/nc-gui-v2/components/smartsheet/sidebar/MenuTop.vue
  2. 8
      packages/nc-gui-v2/components/smartsheet/sidebar/index.vue

3
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 {

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

Loading…
Cancel
Save