From 6ab90c1be04f798846cca349b78aabf5167dfcf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Fri, 23 Dec 2022 21:12:46 +0100 Subject: [PATCH] Avoid flash on pageload for System and Dark+ themes (#4488) --- views/_layout.pug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/_layout.pug b/views/_layout.pug index 75409e10ca6..9d96a895e3c 100644 --- a/views/_layout.pug +++ b/views/_layout.pug @@ -31,7 +31,8 @@ html(lang="en") | (function () { | try { | var settings = window.localStorage.getItem("!{localStoragePrefix}settings") || '{}'; - | var theme = JSON.parse(settings).theme || 'default'; + | var theme = JSON.parse(settings).theme; + | if (theme !== 'default') theme = 'dark'; | document.documentElement.setAttribute('data-theme', theme); | } catch (e) { | document.documentElement.setAttribute('data-theme', 'default');