Only update to system theme if theme is Default

This commit is contained in:
Thomas Rittson 2021-05-31 14:19:31 +10:00
parent c225210a44
commit 7f5a5a5fbb
1 changed files with 6 additions and 3 deletions

View File

@ -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<string>(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) => {