refactor(editor): Detangle ui store from settings store (no-changelog) (#16384)

This commit is contained in:
Alex Grozav
2025-06-17 12:07:46 +02:00
committed by GitHub
parent dd2ed90b95
commit 5caf7a2660
5 changed files with 47 additions and 30 deletions

View File

@@ -16,6 +16,8 @@ import SourceControlInitializationErrorMessage from '@/components/SourceControlI
import { useSSOStore } from '@/stores/sso.store';
import { EnterpriseEditionFeature } from '@/constants';
import type { UserManagementAuthenticationMethod } from '@/Interface';
import { useUIStore } from '@/stores/ui.store';
import type { BannerName } from '@n8n/api-types';
export const state = {
initialized: false,
@@ -35,6 +37,7 @@ export async function initializeCore() {
const usersStore = useUsersStore();
const versionsStore = useVersionsStore();
const ssoStore = useSSOStore();
const uiStore = useUIStore();
await settingsStore.initialize();
@@ -49,6 +52,20 @@ export async function initializeCore() {
},
});
const banners: BannerName[] = [];
if (settingsStore.isEnterpriseFeatureEnabled.showNonProdBanner) {
banners.push('NON_PRODUCTION_LICENSE');
}
if (
!(settingsStore.settings.banners?.dismissed || []).includes('V1') &&
settingsStore.settings.versionCli.startsWith('1.')
) {
banners.push('V1');
}
uiStore.initialize({
banners,
});
void useExternalHooks().run('app.mount');
if (!settingsStore.isPreviewMode) {