From 5dbbe8bffa46fa5359a464e8ff98a59525bb3089 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 13 Aug 2022 00:06:23 +0530 Subject: [PATCH] fix(gui-v2): remove unnecessary watchEffect Signed-off-by: Pranav C --- packages/nc-gui-v2/composables/useProject.ts | 9 ++------- packages/nc-gui-v2/middleware/auth.global.ts | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index 94909945ca..990325e791 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -41,15 +41,10 @@ export function useProject(projectId?: MaybeRef) { _projectId = route.params.projectId as string } project.value = await $api.project.read(_projectId!) + await loadProjectRoles() + await loadTables() } - watchEffect(async () => { - if (project?.value) { - await loadProjectRoles() - await loadTables() - } - }) - const projectBaseType = $computed(() => project.value?.bases?.[0]?.type || '') const isMysql = computed(() => ['mysql', 'mysql2'].includes(projectBaseType)) diff --git a/packages/nc-gui-v2/middleware/auth.global.ts b/packages/nc-gui-v2/middleware/auth.global.ts index 55ecafab02..740514cbb2 100644 --- a/packages/nc-gui-v2/middleware/auth.global.ts +++ b/packages/nc-gui-v2/middleware/auth.global.ts @@ -23,7 +23,7 @@ import { useGlobal } from '#imports' export default defineNuxtRouteMiddleware((to, from) => { const state = useGlobal() - /** if shred base allow without validating token */ + /** if shred base allow without validating */ if (to.params?.projectType === 'base') return /** if auth is required or unspecified (same as required) and user is not signed in, redirect to signin page */