1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-20 21:01:29 +01:00

Move retryQueue from main to runtime and rename it to lockedVaultPendingNotifications

This commit is contained in:
Daniel James Smith 2021-10-08 13:23:05 +02:00
parent 2613a8cfea
commit 75c8c4205f
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 5 additions and 4 deletions

View File

@ -127,7 +127,6 @@ export default class MainBackground {
onReplacedRan: boolean; onReplacedRan: boolean;
loginToAutoFill: any = null; loginToAutoFill: any = null;
notificationQueue: any[] = []; notificationQueue: any[] = [];
retryQueue: any[] = [];
private commandsBackground: CommandsBackground; private commandsBackground: CommandsBackground;
private contextMenusBackground: ContextMenusBackground; private contextMenusBackground: ContextMenusBackground;

View File

@ -37,6 +37,8 @@ export default class RuntimeBackground {
private pageDetailsToAutoFill: any[] = []; private pageDetailsToAutoFill: any[] = [];
private onInstalledReason: string = null; private onInstalledReason: string = null;
private lockedVaultPendingNotifications: any[] = [];
constructor(private main: MainBackground, private autofillService: AutofillService, constructor(private main: MainBackground, private autofillService: AutofillService,
private cipherService: CipherService, private platformUtilsService: BrowserPlatformUtilsService, private cipherService: CipherService, private platformUtilsService: BrowserPlatformUtilsService,
private storageService: StorageService, private i18nService: I18nService, private storageService: StorageService, private i18nService: I18nService,
@ -72,8 +74,8 @@ export default class RuntimeBackground {
this.notificationsService.updateConnection(msg.command === 'unlocked'); this.notificationsService.updateConnection(msg.command === 'unlocked');
this.systemService.cancelProcessReload(); this.systemService.cancelProcessReload();
if (this.main.retryQueue.length > 0) { if (this.lockedVaultPendingNotifications.length > 0) {
const retryItem = this.main.retryQueue.pop(); const retryItem = this.lockedVaultPendingNotifications.pop();
await this.processMessage(retryItem.msg, retryItem.sender, null); await this.processMessage(retryItem.msg, retryItem.sender, null);
} }
break; break;
@ -82,7 +84,7 @@ export default class RuntimeBackground {
msg: msg.retryItem, msg: msg.retryItem,
sender: sender, sender: sender,
}; };
this.main.retryQueue.push(retryMessage); this.lockedVaultPendingNotifications.push(retryMessage);
break; break;
case 'logout': case 'logout':
await this.main.logout(msg.expired); await this.main.logout(msg.expired);