Skip to content
Snippets Groups Projects

Update common.js

Merged Michael J. Ryan requested to merge patch-1 into master
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
+ 3
3
@@ -91,9 +91,9 @@ function registerEventListener(scope, callback, params) {
@@ -91,9 +91,9 @@ function registerEventListener(scope, callback, params) {
}
}
function darkmodeRequested() {
function darkmodeRequested() {
const ls = JSON.parse(localStorage.getItem('darkSwitch'));
const ls = localStorage.getItem('darkSwitch');
if (ls) return true;
if (ls === "true") return true;
if (ls === false) return false;
if (ls === "false") return false;
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)) return true;
if ((window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)) return true;
if ($('#darkSwitch').prop('checked')) return true;
if ($('#darkSwitch').prop('checked')) return true;
return false;
return false;
Loading