mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 15:26:15 +08:00
moving auto switch theme loading into setThemes function to fix initial page load
This commit is contained in:
parent
27b9c441b5
commit
253ae8848b
|
@ -1291,6 +1291,7 @@ function setThemes(
|
|||
theme: string,
|
||||
customState: boolean,
|
||||
customThemeColors: string[],
|
||||
autoSwitchTheme: boolean,
|
||||
nosave?: boolean
|
||||
): boolean {
|
||||
if (!isConfigValueValid("themes", theme, ["string"])) return false;
|
||||
|
@ -1310,6 +1311,7 @@ function setThemes(
|
|||
config.customThemeColors = customThemeColors;
|
||||
config.theme = theme;
|
||||
config.customTheme = customState;
|
||||
config.autoSwitchTheme = autoSwitchTheme;
|
||||
saveToLocalStorage("theme", nosave);
|
||||
ConfigEvent.dispatch("setThemes", customState);
|
||||
|
||||
|
@ -1731,11 +1733,11 @@ export function apply(
|
|||
if (configObj !== undefined && configObj !== null) {
|
||||
setThemeLight(configObj.themeLight, true);
|
||||
setThemeDark(configObj.themeDark, true);
|
||||
setAutoSwitchTheme(configObj.autoSwitchTheme, true);
|
||||
setThemes(
|
||||
configObj.theme,
|
||||
configObj.customTheme,
|
||||
configObj.customThemeColors,
|
||||
configObj.autoSwitchTheme,
|
||||
true
|
||||
);
|
||||
setCustomLayoutfluid(configObj.customLayoutfluid, true);
|
||||
|
|
Loading…
Reference in a new issue