Skip to content

Commit 9f2024d

Browse files
authored
fix updating theme from local storage. (#20)
change is not a method of select element.
1 parent 487840f commit 9f2024d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ themeSwitcher.addEventListener('change', () => {
145145
})
146146

147147
+ if (localStorage.theme) {
148-
+ themeSwitcher.change(localStorage.theme)
148+
+ themeSwitcher.value = localStorage.theme ?? "auto";
149+
+ themeSwitcher.dispatchEvent(new Event("change"));
149150
+ }
150151
```
151152

0 commit comments

Comments
 (0)