1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Replace toaster library (#1322)

This commit is contained in:
Oscar Hinton
2021-12-07 19:41:45 +00:00
committed by GitHub
parent 35a7d6434a
commit d5c0783619
87 changed files with 336 additions and 508 deletions

View File

@@ -9,11 +9,10 @@ import {
import { first } from 'rxjs/operators';
import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailRequest';
@@ -23,7 +22,7 @@ import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailReque
templateUrl: 'verify-email-token.component.html',
})
export class VerifyEmailTokenComponent implements OnInit {
constructor(private router: Router, private toasterService: ToasterService,
constructor(private router: Router, private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService, private route: ActivatedRoute,
private apiService: ApiService, private userService: UserService,
private logService: LogService) { }
@@ -38,14 +37,14 @@ export class VerifyEmailTokenComponent implements OnInit {
if (authed) {
await this.apiService.refreshIdentityToken();
}
this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified'));
this.platformUtilsService.showToast('success', null, this.i18nService.t('emailVerified'));
this.router.navigate(['/']);
return;
} catch (e) {
this.logService.error(e);
}
}
this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed'));
this.platformUtilsService.showToast('error', null, this.i18nService.t('emailVerifiedFailed'));
this.router.navigate(['/']);
});
}