mirror of
https://github.com/bitwarden/browser
synced 2026-02-24 16:43:27 +00:00
adjust account security nudge work to updated nudge service
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</popup-header>
|
||||
|
||||
<bit-spotlight
|
||||
*ngIf="(accountSecurityNudgeStatus$ | async)?.hasSpotlightDismissed === false"
|
||||
*ngIf="showAccountSecurityNudge$ | async"
|
||||
[title]="'unlockVault' | i18n"
|
||||
[subtitle]="'unlockVaultDesc' | i18n"
|
||||
(onDismiss)="dismissAccountSecurityNudge()"
|
||||
|
||||
@@ -64,12 +64,7 @@ import {
|
||||
BiometricStateService,
|
||||
BiometricsStatus,
|
||||
} from "@bitwarden/key-management";
|
||||
import {
|
||||
NudgeStatus,
|
||||
SpotlightComponent,
|
||||
VaultNudgesService,
|
||||
VaultNudgeType,
|
||||
} from "@bitwarden/vault";
|
||||
import { SpotlightComponent, NudgesService, NudgeType } from "@bitwarden/vault";
|
||||
|
||||
import { BiometricErrors, BiometricErrorTypes } from "../../../models/biometricErrors";
|
||||
import { BrowserApi } from "../../../platform/browser/browser-api";
|
||||
@@ -127,11 +122,11 @@ export class AccountSecurityComponent implements OnInit, OnDestroy {
|
||||
enableAutoBiometricsPrompt: true,
|
||||
});
|
||||
|
||||
protected accountSecurityNudgeStatus$: Observable<NudgeStatus> =
|
||||
protected showAccountSecurityNudge$: Observable<boolean> =
|
||||
this.accountService.activeAccount$.pipe(
|
||||
getUserId,
|
||||
switchMap((userId) =>
|
||||
this.vaultNudgesService.showNudge$(VaultNudgeType.AccountSecurity, userId),
|
||||
this.vaultNudgesService.showNudgeSpotlight$(NudgeType.AccountSecurity, userId),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -157,7 +152,7 @@ export class AccountSecurityComponent implements OnInit, OnDestroy {
|
||||
private biometricStateService: BiometricStateService,
|
||||
private toastService: ToastService,
|
||||
private biometricsService: BiometricsService,
|
||||
private vaultNudgesService: VaultNudgesService,
|
||||
private vaultNudgesService: NudgesService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -423,7 +418,7 @@ export class AccountSecurityComponent implements OnInit, OnDestroy {
|
||||
if (!activeAccount) {
|
||||
return;
|
||||
}
|
||||
await this.vaultNudgesService.dismissNudge(VaultNudgeType.AccountSecurity, activeAccount.id);
|
||||
await this.vaultNudgesService.dismissNudge(NudgeType.AccountSecurity, activeAccount.id);
|
||||
}
|
||||
|
||||
async saveVaultTimeoutAction(value: VaultTimeoutAction) {
|
||||
@@ -482,7 +477,7 @@ export class AccountSecurityComponent implements OnInit, OnDestroy {
|
||||
title: null,
|
||||
message: this.i18nService.t("unlockPinSet"),
|
||||
});
|
||||
await this.vaultNudgesService.dismissNudge(VaultNudgeType.AccountSecurity, userId);
|
||||
await this.vaultNudgesService.dismissNudge(NudgeType.AccountSecurity, userId);
|
||||
} else {
|
||||
await this.vaultTimeoutSettingsService.clear();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="tw-flex tw-items-center tw-justify-center">
|
||||
<p class="tw-pr-2">{{ "accountSecurity" | i18n }}</p>
|
||||
<span
|
||||
*ngIf="(accountSecurityNudgeStatus$ | async)?.hasBadgeDismissed === false"
|
||||
*ngIf="showAccountSecurityNudge$ | async"
|
||||
bitBadge
|
||||
variant="notification"
|
||||
[attr.aria-label]="'nudgeBadgeAria' | i18n"
|
||||
@@ -91,7 +91,7 @@
|
||||
<div class="tw-flex tw-items-center tw-justify-center">
|
||||
<p class="tw-pr-2">{{ "downloadBitwardenOnAllDevices" | i18n }}</p>
|
||||
<span
|
||||
*ngIf="downloadBitwardenNudgeStatus$ | async"
|
||||
*ngIf="showDownloadBitwardenNudge$ | async"
|
||||
bitBadge
|
||||
variant="notification"
|
||||
[attr.aria-label]="'nudgeBadgeAria' | i18n"
|
||||
|
||||
@@ -51,13 +51,13 @@ export class SettingsV2Component implements OnInit {
|
||||
shareReplay({ bufferSize: 1, refCount: true }),
|
||||
);
|
||||
|
||||
accountSecurityNudgeStatus$: Observable<boolean> = this.authenticatedAccount$.pipe(
|
||||
showAccountSecurityNudge$: Observable<boolean> = this.authenticatedAccount$.pipe(
|
||||
switchMap((account) =>
|
||||
this.nudgesService.showNudgeBadge$(NudgeType.AccountSecurity, account.id),
|
||||
),
|
||||
);
|
||||
|
||||
downloadBitwardenNudgeStatus$: Observable<boolean> = this.authenticatedAccount$.pipe(
|
||||
showDownloadBitwardenNudge$: Observable<boolean> = this.authenticatedAccount$.pipe(
|
||||
switchMap((account) =>
|
||||
this.nudgesService.showNudgeBadge$(NudgeType.DownloadBitwarden, account.id),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user