diff --git a/frontend/src/ts/controllers/theme-controller.ts b/frontend/src/ts/controllers/theme-controller.ts index 6f926de51..c53bc3a0f 100644 --- a/frontend/src/ts/controllers/theme-controller.ts +++ b/frontend/src/ts/controllers/theme-controller.ts @@ -179,14 +179,16 @@ export function set(themeIdentifier: string, isCustom: boolean): void { apply(themeIdentifier, isCustom); } -export function clearPreview(): void { +export function clearPreview(applyTheme = true): void { if (isPreviewingTheme) { isPreviewingTheme = false; randomTheme = null; - if (Config.customTheme) { - apply("custom", true); - } else { - apply(Config.theme, false); + if (applyTheme) { + if (Config.customTheme) { + apply("custom", true); + } else { + apply(Config.theme, false); + } } } } @@ -295,11 +297,11 @@ ConfigEvent.subscribe((eventKey, eventValue, nosave) => { nosave ? preview("custom", true) : set("custom", true); } if (eventKey === "theme") { - clearPreview(); + clearPreview(false); set(eventValue as string, false); } if (eventKey === "setThemes") { - clearPreview(); + clearPreview(false); if (eventValue) { set("custom", true); } else {