1
0
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:
Andreas Coroiu 2023-05-16 16:26:36 +02:00
parent 72f10bab65
commit 3249504ae2
No known key found for this signature in database
GPG Key ID: E70B5FFC81DFEC1A
3 changed files with 18 additions and 3 deletions

View File

@ -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>

View File

@ -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);
}

View File

@ -664,6 +664,9 @@
"supportsEncryption": {
"message": "supports encryption"
},
"loginWithPasskeyEnabled": {
"message": "Log in with passkey turned on"
},
"passkeySaved": {
"message": "$NAME$ saved",
"placeholders": {