1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-29 17:38:04 +01:00

Close login tab before executing existing unlock flow

This commit is contained in:
Daniel James Smith 2021-10-15 15:20:00 +02:00
parent 7388cd174e
commit 9c0bfd28db
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726

View File

@ -54,21 +54,19 @@ export default class RuntimeBackground {
switch (msg.command) {
case 'loggedIn':
case 'unlocked':
if (this.lockedVaultPendingNotifications.length > 0) {
await BrowserApi.closeLoginTab();
if (item?.sender?.tab?.id) {
await BrowserApi.focusSpecifiedTab(item.sender.tab.id);
}
await this.processMessage(item.msg, item.sender, null);
}
await this.main.setIcon();
await this.main.refreshBadgeAndMenu(false);
this.notificationsService.updateConnection(msg.command === 'unlocked');
this.systemService.cancelProcessReload();
if (this.lockedVaultPendingNotifications.length > 0) {
const retryItem = this.lockedVaultPendingNotifications.pop();
await this.processMessage(retryItem.msg, retryItem.sender, null);
await BrowserApi.closeLoginTab();
if (retryItem?.sender?.tab?.id) {
await BrowserApi.focusSpecifiedTab(retryItem.sender.tab.id);
}
}
break;
case 'addToLockedVaultPendingNotifications':
const retryMessage = {