Skip to content

Commit 11deb01

Browse files
committed
feat: update dark mode handling to store theme preference in local state
1 parent 966c949 commit 11deb01

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

webapp/controller/Main.controller.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,11 @@ export default class Main extends BaseController {
623623
switch (theme) {
624624
case "Light":
625625
DarkModeHelper.toLight();
626+
this.local.dark = false;
626627
break;
627628
case "Dark":
628629
DarkModeHelper.toDark();
630+
this.local.dark = true;
629631
break;
630632
case "System":
631633
default: {
@@ -634,8 +636,10 @@ export default class Main extends BaseController {
634636
).matches;
635637
if (prefersDarkScheme) {
636638
DarkModeHelper.toDark();
639+
this.local.dark = true;
637640
} else {
638641
DarkModeHelper.toLight();
642+
this.local.dark = false;
639643
}
640644
break;
641645
}

0 commit comments

Comments
 (0)