From a22b9b5007cd84fbc452d4d6d07e67a2d8a56449 Mon Sep 17 00:00:00 2001 From: jng Date: Tue, 9 Sep 2025 12:20:20 -0400 Subject: [PATCH] small cleanup in at risk callout component and at risk pw guard --- .../at-risk-password-callout.component.html | 8 +++++--- .../popup/guards/at-risk-passwords.guard.ts | 18 ++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html b/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html index f148fdb556d..d2b885b5b6b 100644 --- a/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html +++ b/apps/browser/src/vault/popup/components/at-risk-callout/at-risk-password-callout.component.html @@ -1,10 +1,12 @@ @if (currentPendingTasks().length > 0) { - + {{ - (taskCount === 1 ? "reviewAndChangeAtRiskPassword" : "reviewAndChangeAtRiskPasswordsPlural") - | i18n: taskCount.toString() + (currentPendingTasks().length === 1 + ? "reviewAndChangeAtRiskPassword" + : "reviewAndChangeAtRiskPasswordsPlural" + ) | i18n: currentPendingTasks().length.toString() }} diff --git a/apps/browser/src/vault/popup/guards/at-risk-passwords.guard.ts b/apps/browser/src/vault/popup/guards/at-risk-passwords.guard.ts index 2eee36c9bde..03111859165 100644 --- a/apps/browser/src/vault/popup/guards/at-risk-passwords.guard.ts +++ b/apps/browser/src/vault/popup/guards/at-risk-passwords.guard.ts @@ -51,17 +51,15 @@ export const hasAtRiskPasswords: CanActivateFn = () => { ), ]).pipe( map(([tasks, ciphers]) => { - const atRiskCiphers = tasks - .filter( - (t) => - t.type === SecurityTaskType.UpdateAtRiskCredential && - t.cipherId != null && - ciphers[t.cipherId] != null && - !ciphers[t.cipherId].isDeleted, - ) - .map((t) => ciphers[t.cipherId!]); + const hasAtRiskCiphers = tasks.some( + (t) => + t.type === SecurityTaskType.UpdateAtRiskCredential && + t.cipherId != null && + ciphers[t.cipherId] != null && + !ciphers[t.cipherId].isDeleted, + ); - if (atRiskCiphers.length === 0) { + if (!hasAtRiskCiphers) { return router.createUrlTree(["/tabs/vault"]); } return true;