mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 10:23:52 +00:00
clean up code in at risk password callout component
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
</bit-callout>
|
||||
}
|
||||
|
||||
@if (showTasksResolvedBanner()) {
|
||||
@if (showTasksCompleteBanner()) {
|
||||
<bit-banner
|
||||
class="-tw-m-5 tw-flex tw-flex-col tw-pt-2 tw-px-2 tw-mb-3"
|
||||
bannerType="info"
|
||||
|
||||
@@ -50,22 +50,15 @@ export class AtRiskPasswordCalloutComponent {
|
||||
|
||||
dismissedClicked: WritableSignal<boolean> = signal(false);
|
||||
|
||||
showTasksResolvedBanner = computed(() => {
|
||||
showTasksCompleteBanner = computed(() => {
|
||||
if (this.dismissedClicked()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
(this.atRiskPasswordStateSignal()?.showTasksCompleteBanner &&
|
||||
this.currentPendingTasks()?.length === 0 &&
|
||||
!this.atRiskPasswordStateSignal()?.hadPendingTasks) ||
|
||||
(this.atRiskPasswordStateSignal()?.hadPendingTasks &&
|
||||
this.currentPendingTasks()?.length === 0)
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
const { showTasksCompleteBanner, hadPendingTasks } = this.atRiskPasswordStateSignal() ?? {};
|
||||
const hasPendingTasks = (this.currentPendingTasks()?.length ?? 0) > 0;
|
||||
|
||||
return !hasPendingTasks && (showTasksCompleteBanner || hadPendingTasks);
|
||||
});
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -32,7 +32,7 @@ export class BannerComponent implements OnInit {
|
||||
readonly bannerType = input<BannerType>("info");
|
||||
|
||||
// passing `null` will remove the icon from element from the banner
|
||||
readonly icon = model<string>();
|
||||
readonly icon = model<string | null>();
|
||||
readonly useAlertRole = input(true);
|
||||
readonly showClose = input(true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user