Lock active account first (#5241)
Locking all non-active accounts prior to active lead to process reload issues. Remove unnecessary routing Prefer Record keys to deep Account object value Await promises
This commit is contained in:
parent
aacabf5bdf
commit
c47194b21c
|
@ -180,13 +180,17 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
case "lockVault":
|
case "lockVault":
|
||||||
await this.vaultTimeoutService.lock(message.userId);
|
await this.vaultTimeoutService.lock(message.userId);
|
||||||
break;
|
break;
|
||||||
case "lockAllVaults":
|
case "lockAllVaults": {
|
||||||
for (const userId in await firstValueFrom(this.stateService.accounts$)) {
|
const currentUser = await this.stateService.getUserId();
|
||||||
if (userId != null) {
|
const accounts = await firstValueFrom(this.stateService.accounts$);
|
||||||
await this.vaultTimeoutService.lock(userId);
|
await this.vaultTimeoutService.lock(currentUser);
|
||||||
}
|
Promise.all(
|
||||||
}
|
Object.keys(accounts)
|
||||||
|
.filter((u) => u !== currentUser)
|
||||||
|
.map((u) => this.vaultTimeoutService.lock(u))
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case "locked":
|
case "locked":
|
||||||
this.modalService.closeAll();
|
this.modalService.closeAll();
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue