1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 18:33:50 +00:00

small cleanup in at risk callout component and at risk pw guard

This commit is contained in:
jng
2025-09-09 12:20:20 -04:00
parent 90af629024
commit a22b9b5007
2 changed files with 13 additions and 13 deletions

View File

@@ -1,10 +1,12 @@
@if (currentPendingTasks().length > 0) {
<bit-callout *ngIf="currentPendingTasks().length as taskCount" type="warning" [title]="''">
<bit-callout type="warning" [title]="''">
<i class="bwi bwi-exclamation-triangle tw-text-warning" aria-hidden="true"></i>
<a bitLink [routerLink]="'/at-risk-passwords'">
{{
(taskCount === 1 ? "reviewAndChangeAtRiskPassword" : "reviewAndChangeAtRiskPasswordsPlural")
| i18n: taskCount.toString()
(currentPendingTasks().length === 1
? "reviewAndChangeAtRiskPassword"
: "reviewAndChangeAtRiskPasswordsPlural"
) | i18n: currentPendingTasks().length.toString()
}}
</a>
</bit-callout>

View File

@@ -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;