mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-27 10:31:22 +08:00
fixed config loading causing wrong theme tab to be shown
This commit is contained in:
parent
da438f8464
commit
a7b255cdc1
1 changed files with 15 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue