diff --git a/frontend/src/ts/controllers/theme-controller.ts b/frontend/src/ts/controllers/theme-controller.ts index 340b18cb6628..0ae254e0de34 100644 --- a/frontend/src/ts/controllers/theme-controller.ts +++ b/frontend/src/ts/controllers/theme-controller.ts @@ -279,17 +279,17 @@ async function set( export async function clearPreview(applyTheme = true): Promise { previewState = null; + if (applyTheme || isPreviewingTheme) { + if (randomTheme !== null) { + await apply(randomTheme); + } else if (Config.customTheme) { + await apply("custom"); + } else { + await apply(Config.theme); + } + } if (isPreviewingTheme) { isPreviewingTheme = false; - if (applyTheme) { - if (randomTheme !== null) { - await apply(randomTheme); - } else if (Config.customTheme) { - await apply("custom"); - } else { - await apply(Config.theme); - } - } } }