From 7f5a5a5fbbddcd9bfe7da57c86c3035fa8874147 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Mon, 31 May 2021 14:19:31 +1000 Subject: [PATCH] Only update to system theme if theme is Default --- src/app/app.component.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fe82df24..4511f52e 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) => {