mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 06:10:55 +08:00
Fix theme switcher showing wrong value
This commit is contained in:
parent
a7ed566645
commit
3dc3f1579b
1 changed files with 1 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ if (preference) {
|
||||||
|
|
||||||
export default function setupThemeSelector() {
|
export default function setupThemeSelector() {
|
||||||
const themeSwitch: HTMLInputElement = document.querySelector(".theme-selection input")!;
|
const themeSwitch: HTMLInputElement = document.querySelector(".theme-selection input")!;
|
||||||
|
themeSwitch.checked = preference ? preference === "dark" : true;
|
||||||
themeSwitch?.addEventListener("change", () => {
|
themeSwitch?.addEventListener("change", () => {
|
||||||
if (themeSwitch.checked) {
|
if (themeSwitch.checked) {
|
||||||
document.body.classList.add("theme-dark");
|
document.body.classList.add("theme-dark");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue