mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-13 07:23:39 +08:00
fixed a white flash while loading
This commit is contained in:
parent
ee665fdc1f
commit
6fa13b131f
1 changed files with 8 additions and 6 deletions
|
@ -1146,19 +1146,21 @@ export function setIndicateTypos(it, nosave) {
|
|||
if (!nosave) saveToCookie();
|
||||
}
|
||||
|
||||
export function setCustomTheme(boolean, nosave) {
|
||||
export function setCustomTheme(boolean, nosave, noThemeChange = false) {
|
||||
if (boolean !== undefined) config.customTheme = boolean;
|
||||
if (boolean) {
|
||||
ThemeController.set("custom");
|
||||
} else {
|
||||
ThemeController.set(config.theme);
|
||||
if (!noThemeChange) {
|
||||
if (boolean) {
|
||||
ThemeController.set("custom");
|
||||
} else {
|
||||
ThemeController.set(config.theme);
|
||||
}
|
||||
}
|
||||
if (!nosave) saveToCookie();
|
||||
}
|
||||
|
||||
export function setTheme(name, nosave) {
|
||||
config.theme = name;
|
||||
setCustomTheme(false, true);
|
||||
setCustomTheme(false, true, true);
|
||||
ThemeController.set(config.theme);
|
||||
if (!nosave) saveToCookie();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue