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