Set theme to system in localstorage if null
This commit is contained in:
@@ -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" &&
|
||||
|
||||
Reference in New Issue
Block a user