From 7880550595ee3c85670127591b6ef1953c6d5fdb Mon Sep 17 00:00:00 2001 From: Dmitry Savinov <37292575+savinovd@users.noreply.github.com> Date: Fri, 10 Jan 2020 20:50:58 +0200 Subject: [PATCH] Fix for theme switcher when isDarkOS is true (#2) --- static/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/main.js b/static/js/main.js index eb091ed..fc8288d 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -13,7 +13,7 @@ function initializeThemeSwitcher() { const isDarkOS = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; const theme = localStorage.getItem("theme"); - if (theme === "dark" || isDarkOS) { + if ((theme === "dark" || isDarkOS) && theme !== "light") { document.body.className = "dark-theme"; themeSwitch.checked = true; }