Skip to content

Commit

Permalink
Set theme to system in localstorage if null
Browse files Browse the repository at this point in the history
  • Loading branch information
joncrangle committed Dec 1, 2023
1 parent 1cd1aa8 commit 6e4bba7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion handlers/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<title>ladder</title>
<script>
const handleThemeChange = () => {
const theme = localStorage.getItem("theme");
let theme = localStorage.getItem("theme");
if (theme === null) {
localStorage.setItem("theme", "system");
theme = "system";
}
if (
theme === "dark" ||
(theme === "system" &&
Expand Down

0 comments on commit 6e4bba7

Please sign in to comment.