From d4e9a3e7de80e717983fc3d9b31277064b4fafb8 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 28 Nov 2024 06:05:25 +0000 Subject: [PATCH] fix: avoid integration load if user is not signed-in --- packages/nc-gui/composables/useNocoAi.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useNocoAi.ts b/packages/nc-gui/composables/useNocoAi.ts index 8797addeda..7e36307c75 100644 --- a/packages/nc-gui/composables/useNocoAi.ts +++ b/packages/nc-gui/composables/useNocoAi.ts @@ -348,9 +348,17 @@ export const useNocoAi = createSharedComposable(() => { } } - onMounted(() => { - loadAiIntegrations() - }) + const { signedIn } = useGlobal() + + watch( + signedIn, + (val) => { + if (val) { + loadAiIntegrations() + } + }, + { immediate: true }, + ) return { aiIntegrationAvailable,