diff --git a/packages/frontend/editor-ui/src/composables/usePageRedirectionHelper.test.ts b/packages/frontend/editor-ui/src/composables/usePageRedirectionHelper.test.ts index 2a6dd6e6e6..aaae41ccf9 100644 --- a/packages/frontend/editor-ui/src/composables/usePageRedirectionHelper.test.ts +++ b/packages/frontend/editor-ui/src/composables/usePageRedirectionHelper.test.ts @@ -51,7 +51,7 @@ describe('usePageRedirectionHelper', () => { writable: true, }); - versionStore.setVersionNotificationSettings({ + versionStore.initialize({ enabled: true, endpoint: '', infoUrl: diff --git a/packages/frontend/editor-ui/src/init.ts b/packages/frontend/editor-ui/src/init.ts index 9d5ef447d9..f7543a5a82 100644 --- a/packages/frontend/editor-ui/src/init.ts +++ b/packages/frontend/editor-ui/src/init.ts @@ -66,6 +66,8 @@ export async function initializeCore() { banners, }); + versionsStore.initialize(settingsStore.settings.versionNotifications); + void useExternalHooks().run('app.mount'); if (!settingsStore.isPreviewMode) { diff --git a/packages/frontend/editor-ui/src/stores/settings.store.test.ts b/packages/frontend/editor-ui/src/stores/settings.store.test.ts index a1e3d56cfd..a6df77fa7c 100644 --- a/packages/frontend/editor-ui/src/stores/settings.store.test.ts +++ b/packages/frontend/editor-ui/src/stores/settings.store.test.ts @@ -46,7 +46,7 @@ vi.mock('@n8n/stores/useRootStore', () => ({ vi.mock('@/stores/versions.store', () => ({ useVersionsStore: vi.fn(() => ({ - setVersionNotificationSettings: vi.fn(), + initialize: vi.fn(), })), })); diff --git a/packages/frontend/editor-ui/src/stores/settings.store.ts b/packages/frontend/editor-ui/src/stores/settings.store.ts index bfad85dd1a..28b0b9ebf4 100644 --- a/packages/frontend/editor-ui/src/stores/settings.store.ts +++ b/packages/frontend/editor-ui/src/stores/settings.store.ts @@ -20,7 +20,6 @@ import { UserManagementAuthenticationMethod } from '@/Interface'; import type { IDataObject, WorkflowSettings } from 'n8n-workflow'; import { defineStore } from 'pinia'; import { useRootStore } from '@n8n/stores/useRootStore'; -import { useVersionsStore } from './versions.store'; import { makeRestApiRequest } from '@n8n/rest-api-client'; import { useToast } from '@/composables/useToast'; import { useI18n } from '@n8n/i18n'; @@ -255,7 +254,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => { rootStore.setN8nMetadata(fetchedSettings.n8nMetadata || {}); rootStore.setDefaultLocale(fetchedSettings.defaultLocale); rootStore.setBinaryDataMode(fetchedSettings.binaryDataMode); - useVersionsStore().setVersionNotificationSettings(fetchedSettings.versionNotifications); if (fetchedSettings.telemetry.enabled) { void eventsApi.sessionStarted(rootStore.restApiContext); diff --git a/packages/frontend/editor-ui/src/stores/versions.store.ts b/packages/frontend/editor-ui/src/stores/versions.store.ts index d0b2ed870d..34568bae61 100644 --- a/packages/frontend/editor-ui/src/stores/versions.store.ts +++ b/packages/frontend/editor-ui/src/stores/versions.store.ts @@ -59,7 +59,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { currentVersion.value = params.versions.find((v) => v.name === params.currentVersion); }; - const setVersionNotificationSettings = (settings: IVersionNotificationSettings) => { + const initialize = (settings: IVersionNotificationSettings) => { versionNotificationSettings.value = settings; }; @@ -107,7 +107,7 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { infoUrl, fetchVersions, setVersions, - setVersionNotificationSettings, + initialize, checkForNewVersions, }; });