1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-09-27 03:53:00 +02: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) {