1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

only update menu for certain events

This commit is contained in:
Kyle Spearrin
2018-02-14 08:54:27 -05:00
parent 3bffbbbeb3
commit 400f534ab3
3 changed files with 6 additions and 15 deletions

View File

@@ -89,13 +89,12 @@ export class AppComponent implements OnInit {
window.onkeypress = () => this.recordActivity();
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {
if (message.command !== 'updateAppMenu') {
await this.updateAppMenu();
}
this.ngZone.run(async () => {
switch (message.command) {
case 'loggedIn':
case 'unlocked':
case 'loggedOut':
this.updateAppMenu();
break;
case 'logout':
this.logOut(!!message.expired);
@@ -105,8 +104,7 @@ export class AppComponent implements OnInit {
break;
case 'locked':
this.router.navigate(['lock']);
break;
case 'unlocked':
this.updateAppMenu();
break;
case 'syncStarted':
break;
@@ -152,8 +150,7 @@ export class AppComponent implements OnInit {
this.toasterService.popAsync('warning', this.i18nService.t('loggedOut'),
this.i18nService.t('loginExpired'));
}
await this.router.navigate(['login']);
this.messagingService.send('loggedOut');
this.router.navigate(['login']);
});
}