From c6837ad1586192d167d4c745b99e278de17f3c09 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 29 Jul 2022 16:52:14 +0530 Subject: [PATCH] chore/gui-v2-user-management-added-top-level-await-to-project-page-for-loading-data --- packages/nc-gui-v2/pages/index/index.vue | 4 +--- packages/nc-gui-v2/pages/nc/[projectId]/index.vue | 14 ++------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui-v2/pages/index/index.vue b/packages/nc-gui-v2/pages/index/index.vue index 8f1ad54e40..575ca831eb 100644 --- a/packages/nc-gui-v2/pages/index/index.vue +++ b/packages/nc-gui-v2/pages/index/index.vue @@ -15,7 +15,6 @@ import MdiDatabaseOutline from '~icons/mdi/database-outline' const { $api, $state, $e } = useNuxtApp() const toast = useToast() -const { loadProject } = useProject() const filterQuery = ref('') const loading = ref(true) @@ -122,9 +121,8 @@ $state.sidebarOpen.value = false v-else :custom-row=" (record) => ({ - onClick: async () => { + onClick: () => { $e('a:project:open') - await loadProject(record.id) navigateTo(`/nc/${record.id}`) }, }) diff --git a/packages/nc-gui-v2/pages/nc/[projectId]/index.vue b/packages/nc-gui-v2/pages/nc/[projectId]/index.vue index 6e621feb1b..314a680511 100644 --- a/packages/nc-gui-v2/pages/nc/[projectId]/index.vue +++ b/packages/nc-gui-v2/pages/nc/[projectId]/index.vue @@ -10,18 +10,8 @@ if (!route.params.type) { addTab({ type: 'auth', title: 'Team & Auth' }) } -watch( - () => route.params.projectId, - async (newVal, oldVal) => { - if (newVal !== oldVal) { - clearTabs() - if (newVal) { - await loadProject(newVal as string) - await loadTables() - } - } - }, -) +loadProject(route.params.projectId as string) +loadTables() $state.sidebarOpen.value = true