2018-07-12 17:34:51 +02:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
|
|
|
import { ToasterService } from 'angular2-toaster';
|
|
|
|
|
|
|
|
import { ApiService } from 'jslib/abstractions/api.service';
|
|
|
|
import { I18nService } from 'jslib/abstractions/i18n.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-04-14 23:43:40 +02:00
|
|
|
private toasterService: ToasterService) { }
|
2018-07-12 17:34:51 +02:00
|
|
|
|
|
|
|
async send() {
|
|
|
|
if (this.actionPromise != null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
this.actionPromise = this.apiService.postAccountVerifyEmail();
|
|
|
|
await this.actionPromise;
|
|
|
|
this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));
|
|
|
|
} catch { }
|
|
|
|
this.actionPromise = null;
|
|
|
|
}
|
|
|
|
}
|