diff --git a/lib/launcher.js b/lib/launcher.js index 068fd334..3382eb3e 100644 --- a/lib/launcher.js +++ b/lib/launcher.js @@ -243,7 +243,18 @@ class Launcher { } } - const themeName = this.config.theme || 'forge-light' + // Mirror the NR5+ theme gate from nr-launcher's runtimeSettings.js. + const storedTheme = this.config.theme || 'forge-light' + const snapshotNRVersion = this.snapshot?.modules?.['node-red'] + const nrMajor = parseInt((snapshotNRVersion || '0.0.0').split('.')[0], 10) || 0 + let themeName = storedTheme + if (nrMajor >= 5) { + if (themeName === 'forge-light' || themeName === 'forge-dark' || themeName === 'forge') { + themeName = 'forge' + } + } else if (themeName === 'forge') { + themeName = 'forge-light' + } const assistant = { enabled: this.settings?.assistant?.enabled || false, // overall enable/disable url: `${this.config.forgeURL}/api/v1/assistant/`, // URL for the assistant service