add continue() method

This commit is contained in:
rr-bw 2024-09-11 10:30:09 -07:00
parent c597b92dee
commit 167b246112
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
2 changed files with 23 additions and 2 deletions

View File

@ -174,7 +174,13 @@
<!-- Email Address input -->
<bit-form-field>
<bit-label>{{ "emailAddress" | i18n }}</bit-label>
<input type="email" formControlName="email" bitInput appAutofocus />
<input
type="email"
formControlName="email"
bitInput
appAutofocus
(keyup.enter)="continue()"
/>
</bit-form-field>
<!-- Remember Email input -->
@ -185,7 +191,7 @@
<div class="tw-grid tw-gap-3">
<!-- Continue button -->
<button type="submit" bitButton buttonType="primary" (click)="validateEmail()">
<button type="submit" bitButton buttonType="primary" (click)="continue()">
<span> {{ "continue" | i18n }} </span>
</button>

View File

@ -351,6 +351,21 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
await this.loginEmailService.saveEmailSettings();
}
protected async continue(): Promise<void> {
await this.validateEmail();
if (!this.formGroup.controls.email.valid) {
this.toastService.showToast({
variant: "error",
title: this.i18nService.t("errorOccured"),
message: this.i18nService.t("invalidEmail"),
});
return;
}
this.focusInput();
}
private async getLoginWithDevice(email: string): Promise<void> {
try {
const deviceIdentifier = await this.appIdService.getAppId();