Browse Source

chore(nc-gui): remove duplicate watcher

pull/4031/head
braks 2 years ago
parent
commit
032a9a1d56
  1. 6
      packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
  2. 3
      packages/nc-gui/components/smartsheet/sidebar/index.vue

6
packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue

@ -211,12 +211,6 @@ function openDeleteDialog(view: Record<string, any>) {
close(1000)
}
}
watch(views, (nextViews) => {
if (nextViews?.length && (!activeView.value || !nextViews.includes(activeView.value))) {
activeView.value = nextViews[0]
}
})
</script>
<template>

3
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -63,8 +63,9 @@ watch(
activeView.value = nextViews[0]
}
}
/** if active view is not found, set it to first view */
if (!activeView.value && nextViews.length) {
if (nextViews?.length && (!activeView.value || !nextViews.includes(activeView.value))) {
activeView.value = nextViews[0]
}
},

Loading…
Cancel
Save