diff --git a/assets/js/themes.js b/assets/js/themes.js index 9388d422..223d01f5 100644 --- a/assets/js/themes.js +++ b/assets/js/themes.js @@ -17,7 +17,7 @@ toggle_theme.addEventListener('click', function () { }); window.addEventListener('storage', function (e) { - if (e.key == 'dark_mode') { + if (e.key === 'dark_mode') { update_mode(e.newValue); } }); @@ -38,11 +38,11 @@ function set_mode (bool) { } function update_mode (mode) { - if (mode == 'true' /* for backwards compatibility */ || mode == 'dark') { + if (mode === 'true' /* for backwards compatibility */ || mode === 'dark') { // If dark mode preference set set_mode(true); } - else if (mode != 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches) { + else if (mode !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches) { // If no preference set, but the browser tells us that the operating system has a dark theme set_mode(true); }