diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fe82df243d..4511f52e9c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -124,9 +124,12 @@ export class AppComponent implements OnInit { window.onkeypress = () => this.recordActivity(); }); - this.platformUtilsService.onDefaultSystemThemeChange(theme => { - window.document.documentElement.classList.remove('theme_light', 'theme_dark'); - window.document.documentElement.classList.add('theme_' + theme); + this.platformUtilsService.onDefaultSystemThemeChange(async systemTheme => { + const theme = await this.storageService.get(ConstantsService.themeKey); + if (theme == null) { + window.document.documentElement.classList.remove('theme_light', 'theme_dark'); + window.document.documentElement.classList.add('theme_' + systemTheme); + } }); this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {