summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_partials/scripts.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html
index 9a1ba09..b21a88f 100644
--- a/layouts/_partials/scripts.html
+++ b/layouts/_partials/scripts.html
@@ -2,8 +2,10 @@
<script>
document.addEventListener("DOMContentLoaded", () => {
const themeSelect = document.getElementById('theme-select')
- themeSelect.value = localStorage.getItem('geedeapro.theme')
- themeSelect.onchange = () => switchTheme(themeSelect.value, true)
+ if (themeSelect) {
+ themeSelect.value = localStorage.getItem('geedeapro.theme')
+ themeSelect.onchange = () => switchTheme(themeSelect.value, true)
+ }
})
</script>