fix(editor): Dont check for whats new if in demo mode (#18532)

This commit is contained in:
Nikhil Kuriakose
2025-08-21 13:45:31 +02:00
committed by GitHub
parent 75e563f1c4
commit 9881b9e435
3 changed files with 6 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ import { useToast } from '@/composables/useToast';
import { useI18n } from '@n8n/i18n'; import { useI18n } from '@n8n/i18n';
import SourceControlInitializationErrorMessage from '@/components/SourceControlInitializationErrorMessage.vue'; import SourceControlInitializationErrorMessage from '@/components/SourceControlInitializationErrorMessage.vue';
import { useSSOStore } from '@/stores/sso.store'; import { useSSOStore } from '@/stores/sso.store';
import { EnterpriseEditionFeature } from '@/constants'; import { EnterpriseEditionFeature, VIEWS } from '@/constants';
import type { UserManagementAuthenticationMethod } from '@/Interface'; import type { UserManagementAuthenticationMethod } from '@/Interface';
import { useUIStore } from '@/stores/ui.store'; import { useUIStore } from '@/stores/ui.store';
import type { BannerName } from '@n8n/api-types'; import type { BannerName } from '@n8n/api-types';
@@ -111,6 +111,7 @@ export async function initializeCore() {
*/ */
export async function initializeAuthenticatedFeatures( export async function initializeAuthenticatedFeatures(
initialized: boolean = authenticatedFeaturesInitialized, initialized: boolean = authenticatedFeaturesInitialized,
routeName?: string,
) { ) {
if (initialized) { if (initialized) {
return; return;
@@ -175,7 +176,8 @@ export async function initializeAuthenticatedFeatures(
void insightsStore.weeklySummary.execute(); 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(); void versionsStore.checkForNewVersions();
} }

View File

@@ -788,7 +788,8 @@ router.beforeEach(async (to: RouteLocationNormalized, from, next) => {
*/ */
await initializeCore(); 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 * Redirect to setup page. User should be redirected to this only once

View File

@@ -4,7 +4,6 @@ import {
LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT, LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT,
LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES, LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES,
VERSIONS_MODAL_KEY, VERSIONS_MODAL_KEY,
VIEWS,
WHATS_NEW_MODAL_KEY, WHATS_NEW_MODAL_KEY,
} from '@/constants'; } from '@/constants';
import { STORES } from '@n8n/stores'; import { STORES } from '@n8n/stores';
@@ -20,7 +19,6 @@ import { useUsersStore } from './users.store';
import { useStorage } from '@/composables/useStorage'; import { useStorage } from '@/composables/useStorage';
import { jsonParse } from 'n8n-workflow'; import { jsonParse } from 'n8n-workflow';
import { useTelemetry } from '@/composables/useTelemetry'; import { useTelemetry } from '@/composables/useTelemetry';
import { useRoute } from 'vue-router';
type SetVersionParams = { versions: Version[]; currentVersion: string }; type SetVersionParams = { versions: Version[]; currentVersion: string };
@@ -56,7 +54,6 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
const uiStore = useUIStore(); const uiStore = useUIStore();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const usersStore = useUsersStore(); const usersStore = useUsersStore();
const route = useRoute();
const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES); const readWhatsNewArticlesStorage = useStorage(LOCAL_STORAGE_READ_WHATS_NEW_ARTICLES);
const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT); const lastDismissedWhatsNewCalloutStorage = useStorage(LOCAL_STORAGE_DISMISSED_WHATS_NEW_CALLOUT);
@@ -174,11 +171,6 @@ export const useVersionsStore = defineStore(STORES.VERSIONS, () => {
}; };
const shouldShowWhatsNewCallout = (): boolean => { const shouldShowWhatsNewCallout = (): boolean => {
// Never show if embedded, e.g. in executions iframe
if (route.name === VIEWS.DEMO) {
return false;
}
const createdAt = usersStore.currentUser?.createdAt; const createdAt = usersStore.currentUser?.createdAt;
let hasNewArticle = false; let hasNewArticle = false;
if (createdAt) { if (createdAt) {