1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-09 01:18:22 +02: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;
loginToAutoFill: any = null;
notificationQueue: any[] = [];
retryQueue: any[] = [];
private commandsBackground: CommandsBackground;
private contextMenusBackground: ContextMenusBackground;

View File

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