From ea2b8f0f0ac7d7bf3cbe989768ba670b34da50f5 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 12 Nov 2024 06:45:55 +0000 Subject: [PATCH] fix(nc-gui): load only those extensions which are available --- packages/nc-gui/composables/useExtensions.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/composables/useExtensions.ts b/packages/nc-gui/composables/useExtensions.ts index 190db1e18a..c9a571b03e 100644 --- a/packages/nc-gui/composables/useExtensions.ts +++ b/packages/nc-gui/composables/useExtensions.ts @@ -68,6 +68,10 @@ export const useExtensions = createSharedComposable(() => { const availableExtensions = ref([]) + const availableExtensionIds = computed(() => { + return availableExtensions.value.map((e) => e.id) + }) + // Object to store description content for each extension const descriptionContent = ref>({}) @@ -85,11 +89,11 @@ export const useExtensions = createSharedComposable(() => { }) const extensionList = computed(() => { - return (activeBaseExtensions.value ? activeBaseExtensions.value.extensions : []).sort( - (a: ExtensionType, b: ExtensionType) => { + return (activeBaseExtensions.value ? activeBaseExtensions.value.extensions : []) + .filter((e: ExtensionType) => availableExtensionIds.value.includes(e.extensionId)) + .sort((a: ExtensionType, b: ExtensionType) => { return (a?.order ?? Infinity) - (b?.order ?? Infinity) - }, - ) + }) }) const toggleExtensionPanel = () => {