1
mirror of https://github.com/jakejarvis/dark-mode.git synced 2025-04-25 18:45:23 -04:00

remove toggle || null (already checked for)

This commit is contained in:
Jake Jarvis 2021-10-04 09:26:15 -04:00
parent 1c1ff4e186
commit 9c9351398d
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39

View File

@ -22,7 +22,7 @@ const init = function (options) {
const activateTheme = function (theme, remember) {
// optional onChange callback function passed as option
if (typeof options.onChange === "function") {
options.onChange(theme, toggle || null);
options.onChange(theme, toggle);
}
document.body.classList.remove(dark, light);
@ -36,7 +36,7 @@ const init = function (options) {
// optional onInit callback function passed as option
if (typeof options.onInit === "function") {
options.onInit(toggle || null);
options.onInit(toggle);
}
// user has never clicked the button, so go by their OS preference until/if they do so