1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01: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']);
});
}

View File

@ -45,12 +45,6 @@ export class MessagingMain {
onMessage(message: any) {
switch (message.command) {
case 'loggedIn':
break;
case 'logout':
break;
case 'syncCompleted':
break;
case 'scheduleNextSync':
this.scheduleNextSync();
break;

View File

@ -1,9 +1,9 @@
import { isDev } from '../scripts/utils';
import { app, BrowserWindow, screen } from 'electron';
import * as path from 'path';
import * as url from 'url';
import { Main } from '../main';
import { isDev } from '../scripts/utils';
export class WindowMain {
win: BrowserWindow;