diff --git a/webv4/root/js/common.js b/webv4/root/js/common.js index 79c5e6c87a7a2aef6b749e9dbe8dae61c3240fdb..a48b8843eaa5fcf5b30bbb5c187176c2587bc4a8 100644 --- a/webv4/root/js/common.js +++ b/webv4/root/js/common.js @@ -91,9 +91,9 @@ function registerEventListener(scope, callback, params) { } function darkmodeRequested() { - const ls = JSON.parse(localStorage.getItem('darkSwitch')); - if (ls) return true; - if (ls === false) return false; + const ls = localStorage.getItem('darkSwitch'); + if (ls === "true") return true; + if (ls === "false") return false; if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)) return true; if ($('#darkSwitch').prop('checked')) return true; return false;