From 8b578852525f1629c3faf8e1ffe9803d0126c556 Mon Sep 17 00:00:00 2001 From: hackademix Date: Wed, 23 Mar 2022 00:57:11 +0100 Subject: [PATCH] Open the appearance page for users to configure their preferred visual theme on upgrade from 11.4.1rc3 and below. --- src/bg/LifeCycle.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bg/LifeCycle.js b/src/bg/LifeCycle.js index 0a23e55..3ac74bf 100644 --- a/src/bg/LifeCycle.js +++ b/src/bg/LifeCycle.js @@ -314,6 +314,16 @@ var LifeCycle = (() => { // add the lan capability to any preset which already has the script capability await configureNewCap("lan", ["DEFAULT", "TRUSTED", "CUSTOM"], caps => caps.has("script")); } + + if (Ver.is(previousVersion, "<=", "11.4.1rc3")) { + // show theme switcher on update unless user has already chosen between Vintage Blue and Modern Red + (async () => { + let isVintage = await Themes.isVintage(); + if (typeof isVintage === "boolean") return; + await ns.init; + ns.openOptionsPage({tab: 2, focus: "#opt-vintageTheme", hilite: "#sect-themes"}); + })(); + } }, async onUpdateAvailable(details) {