1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

[PM-22420] Show success toast and dismiss nudge ONLY when PIN is set (#15151)

* check for PIN value before showing toast and dismissing nudge
This commit is contained in:
Jason Ng
2025-06-11 17:30:40 -04:00
committed by GitHub
parent c52e6a3f2c
commit b75eb1c81a

View File

@@ -474,12 +474,14 @@ export class AccountSecurityComponent implements OnInit, OnDestroy {
this.form.controls.pin.setValue(userHasPinSet, { emitEvent: false }); this.form.controls.pin.setValue(userHasPinSet, { emitEvent: false });
const requireReprompt = (await this.pinService.getPinLockType(userId)) == "EPHEMERAL"; const requireReprompt = (await this.pinService.getPinLockType(userId)) == "EPHEMERAL";
this.form.controls.pinLockWithMasterPassword.setValue(requireReprompt, { emitEvent: false }); this.form.controls.pinLockWithMasterPassword.setValue(requireReprompt, { emitEvent: false });
this.toastService.showToast({ if (userHasPinSet) {
variant: "success", this.toastService.showToast({
title: null, variant: "success",
message: this.i18nService.t("unlockPinSet"), title: null,
}); message: this.i18nService.t("unlockPinSet"),
await this.vaultNudgesService.dismissNudge(NudgeType.AccountSecurity, userId); });
await this.vaultNudgesService.dismissNudge(NudgeType.AccountSecurity, userId);
}
} else { } else {
const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); const userId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
await this.vaultTimeoutSettingsService.clear(userId); await this.vaultTimeoutSettingsService.clear(userId);