Browse Source

refactor/gui-v2-settings-modal-minor-cleanup

pull/2813/head
Muhammed Mustafa 2 years ago
parent
commit
f6cf44029d
  1. 12
      packages/nc-gui-v2/components/dashboard/settings/SettingsModal.vue

12
packages/nc-gui-v2/components/dashboard/settings/SettingsModal.vue

@ -87,17 +87,7 @@ const selectedTabKeys = $ref<string[]>([firstKeyOfObject(tabsInfo)])
const selectedTab = $computed(() => tabsInfo[selectedTabKeys[0]]) const selectedTab = $computed(() => tabsInfo[selectedTabKeys[0]])
let selectedSubTabKeys = $ref<string[]>([firstKeyOfObject(selectedTab.subTabs)]) let selectedSubTabKeys = $ref<string[]>([firstKeyOfObject(selectedTab.subTabs)])
const selectedSubTab = $computed(() => { const selectedSubTab = $computed(() => selectedTab.subTabs[selectedSubTabKeys[0]])
const isSubTabInSelectedTab = (subTab: any) => subTab in selectedTab.subTabs
// Select the first subtab
const currentlySelectedSubTabKey = selectedSubTabKeys[0]
const subTabKey = isSubTabInSelectedTab(currentlySelectedSubTabKey)
? currentlySelectedSubTabKey
: firstKeyOfObject(selectedTab.subTabs)
return selectedTab.subTabs[subTabKey]
})
watch( watch(
() => selectedTabKeys[0], () => selectedTabKeys[0],

Loading…
Cancel
Save