Fix for theme switcher when isDarkOS is true (#2)

This commit is contained in:
Dmitry Savinov
2020-01-10 20:50:58 +02:00
committed by Vasily Zubarev
parent 9b2ec406b2
commit 7880550595

View File

@@ -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;
}