mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-22 21:21:35 +01:00
[PM-2057] update two factor email dialog (#9547)
* migrating two factor email component * two factor email component migration * two factor email component migration * two factor email component migration * two factor email component migration
This commit is contained in:
parent
e6803e05ee
commit
832abcd955
@ -26,12 +26,12 @@
|
||||
appInputVerbatim="false"
|
||||
/>
|
||||
</bit-form-field>
|
||||
<div class="tw-mb-3 tw-flex">
|
||||
<div class="tw-mb-3 tw-flex tw-items-center">
|
||||
<button bitButton type="button" buttonType="primary" [bitAction]="sendEmail">
|
||||
{{ "sendEmail" | i18n }}
|
||||
</button>
|
||||
<span class="tw-text-success tw-ml-3" *ngIf="sentEmail">
|
||||
{{ "verificationCodeEmailSent" | i18n: sentEmail }}
|
||||
{{ "emailSent" | i18n }}
|
||||
</span>
|
||||
</div>
|
||||
<bit-form-field>
|
||||
|
@ -31,7 +31,7 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
|
||||
emailPromise: Promise<unknown>;
|
||||
override componentName = "app-two-factor-email";
|
||||
formGroup = this.formBuilder.group({
|
||||
token: [null],
|
||||
token: ["", [Validators.required]],
|
||||
email: ["", [Validators.email, Validators.required]],
|
||||
});
|
||||
|
||||
@ -79,6 +79,10 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
|
||||
}
|
||||
|
||||
submit = async () => {
|
||||
this.formGroup.markAllAsTouched();
|
||||
if (this.formGroup.invalid) {
|
||||
return;
|
||||
}
|
||||
if (this.enabled) {
|
||||
await this.disableEmail();
|
||||
this.onChangeStatus.emit(false);
|
||||
|
Loading…
Reference in New Issue
Block a user