mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-24 21:41:33 +01:00
[PM-2014] feat: change toast depending on existing passkeys
This commit is contained in:
parent
72f10bab65
commit
3249504ae2
@ -59,7 +59,7 @@
|
||||
{{ "tryAgain" | i18n }}
|
||||
</ng-container>
|
||||
<ng-container *ngIf="currentStep === 'credentialNaming'">
|
||||
{{ ((hasPasskeys$ | async) ? "save" : "turnOn ") | i18n }}
|
||||
{{ ((hasPasskeys$ | async) ? "save" : "enable") | i18n }}
|
||||
</ng-container>
|
||||
</button>
|
||||
<button type="button" bitButton bitFormButton buttonType="secondary" bitDialogClose>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DialogConfig, DialogRef } from "@angular/cdk/dialog";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormBuilder, Validators } from "@angular/forms";
|
||||
import { map, Observable } from "rxjs";
|
||||
import { firstValueFrom, map, Observable } from "rxjs";
|
||||
|
||||
import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog";
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
@ -144,7 +144,19 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
this.platformUtilsService.showToast("success", null, this.i18nService.t("passkeySaved", name));
|
||||
if (firstValueFrom(this.hasPasskeys$)) {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("passkeySaved", name)
|
||||
);
|
||||
} else {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("loginWithPasskeyEnabled")
|
||||
);
|
||||
}
|
||||
|
||||
this.dialogRef.close(CreateCredentialDialogResult.Success);
|
||||
}
|
||||
|
@ -664,6 +664,9 @@
|
||||
"supportsEncryption": {
|
||||
"message": "supports encryption"
|
||||
},
|
||||
"loginWithPasskeyEnabled": {
|
||||
"message": "Log in with passkey turned on"
|
||||
},
|
||||
"passkeySaved": {
|
||||
"message": "$NAME$ saved",
|
||||
"placeholders": {
|
||||
|
Loading…
Reference in New Issue
Block a user