mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
verify email and outdated browser callouts
This commit is contained in:
15
src/app/settings/verify-email.component.html
Normal file
15
src/app/settings/verify-email.component.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="card border-warning">
|
||||
<div class="card-header bg-warning text-white">
|
||||
<i class="fa fa-envelope-o fa-fw"></i> {{'verifyEmail' | i18n}}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>{{'verifyEmailDesc' | i18n}}</p>
|
||||
<button type="button" class="btn btn-block btn-outline-secondary btn-submit" #sendBtn [appApiAction]="actionPromise" [disabled]="sendBtn.loading"
|
||||
(click)="send()">
|
||||
<i class="fa fa-spin fa-spinner"></i>
|
||||
<span>
|
||||
{{'sendEmail' | i18n}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
31
src/app/settings/verify-email.component.ts
Normal file
31
src/app/settings/verify-email.component.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
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,
|
||||
private analytics: Angulartics2, private toasterService: ToasterService) { }
|
||||
|
||||
async send() {
|
||||
if (this.actionPromise != null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.actionPromise = this.apiService.postAccountVerifyEmail();
|
||||
await this.actionPromise;
|
||||
this.analytics.eventTrack.next({ action: 'Sent Verification Email' });
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('checkInboxForVerification'));
|
||||
} catch { }
|
||||
this.actionPromise = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user