From c9195bd11dfa50bcbc874b21afce251e41d2495d Mon Sep 17 00:00:00 2001 From: Sijisu Date: Tue, 3 Aug 2021 18:50:05 +0000 Subject: [PATCH] Hopefully fix indentation --- themes/patek/assets/js/dark-mode.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/patek/assets/js/dark-mode.js b/themes/patek/assets/js/dark-mode.js index 4c18eb9..195c5a2 100644 --- a/themes/patek/assets/js/dark-mode.js +++ b/themes/patek/assets/js/dark-mode.js @@ -6,9 +6,9 @@ function restoreDarkmode() { elem.classList.add("dark-mode"); } } - if (elem && document.cookie.includes("dark-mode=on")) { + if (elem && document.cookie.includes("dark-mode=on")) { elem.classList.add("dark-mode"); - } + } } function toggleDarkmode() { @@ -16,10 +16,10 @@ function toggleDarkmode() { if (elem) { const state = elem.classList.toggle('dark-mode'); if (state) { - // 31536000 = 1 year; not setting max-age would make it session bound + // 31536000 = 1 year; not setting max-age would make it session bound document.cookie = 'dark-mode=on; path=/; max-age=31536000; secure; samesite=strict'; } else { - // We have to set the off preference as well, so it can override the OS setting + // We have to set the off preference as well, so it can override the OS setting document.cookie = 'dark-mode=off; path=/; max-age=31536000; secure; samesite=strict'; } }