From ea133eaa7d628d5d292dc68a0fc7cbd5b360d448 Mon Sep 17 00:00:00 2001 From: Noley Holland Date: Mon, 4 May 2026 11:36:14 -0700 Subject: [PATCH] Update launcher to gate theme for node-RED 5 --- lib/launcher.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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