aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-09 15:29:06 -0800
committerFuwn <[email protected]>2023-12-09 15:29:06 -0800
commit9d0c4ca071b3614ff5dc14bb758c64d5e1ab3430 (patch)
tree8e284826c3499b02083a6087f0519ef5441f68ae
parentci(earthly): remove check from all (diff)
downloaddue.moe-9d0c4ca071b3614ff5dc14bb758c64d5e1ab3430.tar.xz
due.moe-9d0c4ca071b3614ff5dc14bb758c64d5e1ab3430.zip
fix(html): null check settings
-rw-r--r--src/app.html10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/app.html b/src/app.html
index 090cc8f9..c38658ca 100644
--- a/src/app.html
+++ b/src/app.html
@@ -66,7 +66,10 @@
<meta name="msapplication-square310x310logo" content="mstile-310x310.png" />
<script>
- if (JSON.parse(localStorage.getItem('settings')).forceLightTheme === true) {
+ if (
+ localStorage.getItem('settings') &&
+ JSON.parse(localStorage.getItem('settings')).forceLightTheme === true
+ ) {
document.documentElement.classList.add('light-theme');
} else {
document.documentElement.classList.add('dark-theme');
@@ -76,7 +79,10 @@
const header = document.getElementById('header');
const hoverHeader = document.getElementById('hover-header');
- if (JSON.parse(localStorage.getItem('settings')).hoverNavigation === true) {
+ if (
+ localStorage.getItem('settings') &&
+ JSON.parse(localStorage.getItem('settings')).hoverNavigation === true
+ ) {
header.style.display = 'none';
hoverHeader.style.display = 'block';
} else {