bitwarden-estensione-browser/apps/web/src/app/settings/verify-email.component.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Component } from "@angular/core";
2022-06-14 17:10:53 +02:00
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
@Component({
selector: "app-verify-email",
templateUrl: "verify-email.component.html",
})
export class VerifyEmailComponent {
actionPromise: Promise<any>;
constructor(
private apiService: ApiService,
private i18nService: I18nService,
2021-12-07 20:41:45 +01:00
private platformUtilsService: PlatformUtilsService,
private logService: LogService
) {}
async send() {
if (this.actionPromise != null) {
return;
}
2021-12-17 15:57:11 +01:00
try {
this.actionPromise = this.apiService.postAccountVerifyEmail();
await this.actionPromise;
2021-12-07 20:41:45 +01:00
this.platformUtilsService.showToast(
2021-12-17 15:57:11 +01:00
"success",
null,
2021-12-07 20:41:45 +01:00
this.i18nService.t("checkInboxForVerification")
2021-12-17 15:57:11 +01:00
);
} catch (e) {
this.logService.error(e);
2021-12-17 15:57:11 +01:00
}
this.actionPromise = null;
2021-12-17 15:57:11 +01:00
}
}