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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user