mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Respond to native OS theme changes
This commit is contained in:
@@ -124,6 +124,11 @@ export class AppComponent implements OnInit {
|
|||||||
window.onkeypress = () => this.recordActivity();
|
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.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
|
||||||
this.ngZone.run(async () => {
|
this.ngZone.run(async () => {
|
||||||
switch (message.command) {
|
switch (message.command) {
|
||||||
|
|||||||
Reference in New Issue
Block a user