From 555ee1c230009ea71930c23e9504dd8c8c402430 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Tue, 25 Jan 2022 09:36:30 -0500 Subject: [PATCH] [bug] Checkout all vaults before reloading process (#1267) --- src/app/app.component.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d7a8ae19bd..5c1d438e76 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -154,8 +154,8 @@ export class AppComponent implements OnInit { } this.notificationsService.updateConnection(); this.updateAppMenu(); - this.systemService.startProcessReload(); await this.systemService.clearPendingClipboard(); + await this.reloadProcess(); break; case "authBlocked": this.router.navigate(["login"]); @@ -187,8 +187,8 @@ export class AppComponent implements OnInit { } this.notificationsService.updateConnection(); await this.updateAppMenu(); - this.systemService.startProcessReload(); await this.systemService.clearPendingClipboard(); + await this.reloadProcess(); break; case "reloadProcess": window.location.reload(true); @@ -571,4 +571,16 @@ export class AppComponent implements OnInit { }); } } + + private async reloadProcess(): Promise { + const accounts = Object.keys(this.stateService.accounts.getValue()); + if (accounts.length > 0) { + for (const userId in accounts) { + if (!(await this.vaultTimeoutService.isLocked(accounts[userId]))) { + return; + } + } + } + await this.systemService.startProcessReload(); + } }