Update dark-mode.js

This commit is contained in:
2020-05-04 12:49:06 -04:00
committed by GitHub
parent 4a36b8c526
commit 7d8aa59530
+4 -4
View File
@@ -67,12 +67,12 @@
// handle toggle click // handle toggle click
toggle.addEventListener('click', function () { toggle.addEventListener('click', function () {
// switch to the opposite theme & save preference in local storage // switch to the opposite theme & save preference in local storage
if (!active) { if (active) {
activateTheme(dark);
storage.setItem(pref_key, dark);
} else {
activateTheme(light); activateTheme(light);
storage.setItem(pref_key, light); storage.setItem(pref_key, light);
} else {
activateTheme(dark);
storage.setItem(pref_key, dark);
} }
}, true); }, true);
} }