1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-29 17:38:04 +01:00

Respond to native OS theme changes

This commit is contained in:
Thomas Rittson 2021-05-31 13:36:26 +10:00
parent c7345197f7
commit c225210a44

View File

@ -124,6 +124,11 @@ 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.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
this.ngZone.run(async () => {
switch (message.command) {