Skip to content
Snippets Groups Projects
Commit 17c0644e authored by Michael J. Ryan's avatar Michael J. Ryan
Browse files

Update common.js

When the property was changed, it now blows up on any browser with the previous configuration schema, explicitly checking for the expected text value without parsing.
parent 6015652c
No related branches found
No related tags found
2 merge requests!463MRC mods by Codefenix (2024-10-20),!112Update common.js
Pipeline #1379 passed
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment