mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-25 22:12:31 +08:00
Fix theme switcher showing wrong value
This commit is contained in:
parent
a7ed566645
commit
3dc3f1579b
@ -12,6 +12,7 @@ if (preference) {
|
||||
|
||||
export default function setupThemeSelector() {
|
||||
const themeSwitch: HTMLInputElement = document.querySelector(".theme-selection input")!;
|
||||
themeSwitch.checked = preference ? preference === "dark" : true;
|
||||
themeSwitch?.addEventListener("change", () => {
|
||||
if (themeSwitch.checked) {
|
||||
document.body.classList.add("theme-dark");
|
||||
|
Loading…
x
Reference in New Issue
Block a user