From a7b255cdc1610e90b4c94845bf47f6fefbd7a47b Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 8 Jan 2022 16:58:03 +0100 Subject: [PATCH] fixed config loading causing wrong theme tab to be shown --- src/js/config.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index b880df4cc..d7c255d8a 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1261,6 +1261,18 @@ export function setTheme(name, nosave) { if (!nosave) saveToLocalStorage(); } +function setThemes(theme, customState, nosave) { + config.theme = theme; + config.customTheme = customState; + ThemeController.clearPreview(); + if (customState) { + ThemeController.set("custom"); + } else { + ThemeController.set(config.theme); + } + if (!nosave) saveToLocalStorage(); +} + export function setRandomTheme(val, nosave) { if (val === undefined || val === true || val === false) { val = "off"; @@ -1583,9 +1595,10 @@ export function apply(configObj) { } }); if (configObj && configObj != null && configObj != "null") { - setTheme(configObj.theme, true); setCustomThemeColors(configObj.customThemeColors, true); - setCustomTheme(configObj.customTheme, true, true); + setThemes(configObj.theme, configObj.customTheme, true); + // setTheme(configObj.theme, true); + // setCustomTheme(configObj.customTheme, true, true); setCustomLayoutfluid(configObj.customLayoutfluid, true); setCustomBackground(configObj.customBackground, true); setCustomBackgroundSize(configObj.customBackgroundSize, true);