Set theme to system in localstorage if null

This commit is contained in:
joncrangle
2023-12-01 01:09:42 -05:00
parent 1cd1aa805d
commit 6e4bba7f91

View File

@@ -7,7 +7,11 @@
<title>ladder</title> <title>ladder</title>
<script> <script>
const handleThemeChange = () => { const handleThemeChange = () => {
const theme = localStorage.getItem("theme"); let theme = localStorage.getItem("theme");
if (theme === null) {
localStorage.setItem("theme", "system");
theme = "system";
}
if ( if (
theme === "dark" || theme === "dark" ||
(theme === "system" && (theme === "system" &&