1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

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

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) => {