1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Use messages/events instead of main.unlockCompleted

This commit is contained in:
Daniel James Smith
2021-10-18 16:41:42 +02:00
parent 2699e0f5a0
commit fd8de4ca0c
5 changed files with 33 additions and 29 deletions

View File

@@ -129,16 +129,15 @@ export default class MainBackground {
onUpdatedRan: boolean;
onReplacedRan: boolean;
loginToAutoFill: CipherView = null;
lockedVaultPendingNotifications: { commandToRetry: any, from: string }[] = [];
private commandsBackground: CommandsBackground;
private contextMenusBackground: ContextMenusBackground;
private idleBackground: IdleBackground;
private notificationBackground: NotificationBackground;
private runtimeBackground: RuntimeBackground;
private tabsBackground: TabsBackground;
private webRequestBackground: WebRequestBackground;
private windowsBackground: WindowsBackground;
private notificationBackground: NotificationBackground;
private sidebarAction: any;
private buildingContextMenu: boolean;
@@ -344,21 +343,6 @@ export default class MainBackground {
}
}
async unlockCompleted() {
if (this.lockedVaultPendingNotifications.length === 0) {
return;
}
const item = this.lockedVaultPendingNotifications.pop();
switch (item.from) {
case 'notificationBar':
await this.notificationBackground.processMessage(item.commandToRetry, item.commandToRetry.sender, null);
break;
default:
break;
}
}
async logout(expired: boolean) {
await this.eventService.uploadEvents();
const userId = await this.userService.getUserId();