Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
fix(settings): set dark mode immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Sep 21, 2020
1 parent 30fb7db commit 2ea0830
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@ export class SettingsService {
return this.getBoolean('darkMode');
}
async setDarkMode(dark: boolean) {
return this.setBoolean('darkMode', dark);
return this.setBoolean('darkMode', dark).then(() => {
if (dark) {
document.body.classList.add('dark');
} else {
document.body.classList.remove('dark');
}
});
}

disableSleep(): boolean {
Expand Down

0 comments on commit 2ea0830

Please sign in to comment.