From 9881b9e4358be73210cfda52c024d6ffd4318178 Mon Sep 17 00:00:00 2001 From: Nikhil Kuriakose Date: Thu, 21 Aug 2025 13:45:31 +0200 Subject: [PATCH] fix(editor): Dont check for whats new if in demo mode (#18532) --- packages/frontend/editor-ui/src/init.ts | 6 ++++-- packages/frontend/editor-ui/src/router.ts | 3 ++- packages/frontend/editor-ui/src/stores/versions.store.ts | 8 -------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/frontend/editor-ui/src/init.ts b/packages/frontend/editor-ui/src/init.ts index 3760356b59..82a0cef3a1 100644 --- a/packages/frontend/editor-ui/src/init.ts +++ b/packages/frontend/editor-ui/src/init.ts @@ -14,7 +14,7 @@ import { useToast } from '@/composables/useToast'; import { useI18n } from '@n8n/i18n'; import SourceControlInitializationErrorMessage from '@/components/SourceControlInitializationErrorMessage.vue'; import { useSSOStore } from '@/stores/sso.store'; -import { EnterpriseEditionFeature } from '@/constants'; +import { EnterpriseEditionFeature, VIEWS } from '@/constants'; import type { UserManagementAuthenticationMethod } from '@/Interface'; import { useUIStore } from '@/stores/ui.store'; import type { BannerName } from '@n8n/api-types'; @@ -111,6 +111,7 @@ export async function initializeCore() { */ export async function initializeAuthenticatedFeatures( initialized: boolean = authenticatedFeaturesInitialized, + routeName?: string, ) { if (initialized) { return; @@ -175,7 +176,8 @@ export async function initializeAuthenticatedFeatures( void insightsStore.weeklySummary.execute(); } - if (!settingsStore.isPreviewMode) { + // Don't check for new versions in preview mode or demo view (ex: executions iframe) + if (!settingsStore.isPreviewMode && routeName !== VIEWS.DEMO) { void versionsStore.checkForNewVersions(); } diff --git a/packages/frontend/editor-ui/src/router.ts b/packages/frontend/editor-ui/src/router.ts index ab6631053c..cf43f22aed 100644 --- a/packages/frontend/editor-ui/src/router.ts +++ b/packages/frontend/editor-ui/src/router.ts @@ -788,7 +788,8 @@ router.beforeEach(async (to: RouteLocationNormalized, from, next) => { */ await initializeCore(); - await initializeAuthenticatedFeatures(); + // Pass undefined for first param to use default + await initializeAuthenticatedFeatures(undefined, to.name as string); /** * Redirect to setup page. User should be redirected to this only once diff --git a/packages/frontend/editor-ui/src/stores/versions.store.ts b/packages/frontend/editor-ui/src/stores/versions.store.ts index 5348255aec..e5a84a287f 100644 --- a/packages/frontend/editor-ui/src/stores/versions.store.ts +++ b/packages/frontend/editor-ui/src/stores/versions.store.ts @@ -4,7 +4,6 @@ import { LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT, LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES, VERSIONS_MODAL_KEY, - VIEWS, WHATS_NEW_MODAL_KEY, } from '@/constants'; import { STORES } from '@n8n/stores'; @@ -20,7 +19,6 @@ import { useUsersStore } from './users.store'; import { useStorage } from '@/composables/useStorage'; import { jsonParse } from 'n8n-workflow'; import { useTelemetry } from '@/composables/useTelemetry'; -import { useRoute } from 'vue-router'; type SetVersionParams = { versions: Version[]; currentVersion: string }; @@ -56,7 +54,6 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { const uiStore = useUIStore(); const settingsStore = useSettingsStore(); const usersStore = useUsersStore(); - const route = useRoute(); const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES); const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT); @@ -174,11 +171,6 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => { }; const shouldShowWhatsNewCallout = (): boolean => { - // Never show if embedded, e.g. in executions iframe - if (route.name === VIEWS.DEMO) { - return false; - } - const createdAt = usersStore.currentUser?.createdAt; let hasNewArticle = false; if (createdAt) {