From 0ab24c814abd1787268750ba808993ab2735ac52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 29 Oct 2024 11:37:10 +0100 Subject: [PATCH] fix(editor): Run external hooks after settings have been initialized (#11423) --- packages/editor-ui/src/App.vue | 2 -- packages/editor-ui/src/init.ts | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 77d371855c..47d2f1268b 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -8,7 +8,6 @@ import Modals from '@/components/Modals.vue'; import Telemetry from '@/components/Telemetry.vue'; import AskAssistantFloatingButton from '@/components/AskAssistant/AskAssistantFloatingButton.vue'; import { loadLanguage } from '@/plugins/i18n'; -import { useExternalHooks } from '@/composables/useExternalHooks'; import { APP_MODALS_ELEMENT_ID, HIRING_BANNER, VIEWS } from '@/constants'; import { useRootStore } from '@/stores/root.store'; import { useAssistantStore } from '@/stores/assistant.store'; @@ -46,7 +45,6 @@ watch(defaultLocale, (newLocale) => { onMounted(async () => { setAppZIndexes(); logHiringBanner(); - void useExternalHooks().run('app.mount'); loading.value = false; window.addEventListener('resize', updateGridWidth); await updateGridWidth(); diff --git a/packages/editor-ui/src/init.ts b/packages/editor-ui/src/init.ts index b523393f31..9457063d6d 100644 --- a/packages/editor-ui/src/init.ts +++ b/packages/editor-ui/src/init.ts @@ -4,6 +4,7 @@ import { useRootStore } from '@/stores/root.store'; import { useSettingsStore } from '@/stores/settings.store'; import { useSourceControlStore } from '@/stores/sourceControl.store'; import { useUsersStore } from '@/stores/users.store'; +import { useExternalHooks } from '@/composables/useExternalHooks'; import { initializeCloudHooks } from '@/hooks/register'; import { useVersionsStore } from '@/stores/versions.store'; import { useProjectsStore } from '@/stores/projects.store'; @@ -26,6 +27,9 @@ export async function initializeCore() { const versionsStore = useVersionsStore(); await settingsStore.initialize(); + + void useExternalHooks().run('app.mount'); + if (!settingsStore.isPreviewMode) { await usersStore.initialize();