1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

refactor toaster to platform showToast

This commit is contained in:
Kyle Spearrin
2018-10-02 23:09:19 -04:00
parent 45341ec408
commit f793ff0aa5
21 changed files with 85 additions and 117 deletions

View File

@@ -1,4 +1,3 @@
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { OnInit } from '@angular/core';
@@ -14,7 +13,7 @@ export class PasswordGeneratorHistoryComponent implements OnInit {
constructor(protected passwordGenerationService: PasswordGenerationService, protected analytics: Angulartics2,
protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,
protected toasterService: ToasterService, private win: Window) { }
private win: Window) { }
async ngOnInit() {
this.history = await this.passwordGenerationService.getHistory();
@@ -29,6 +28,7 @@ export class PasswordGeneratorHistoryComponent implements OnInit {
this.analytics.eventTrack.next({ action: 'Copied Historical Password' });
const copyOptions = this.win != null ? { window: this.win } : null;
this.platformUtilsService.copyToClipboard(password, copyOptions);
this.toasterService.popAsync('info', null, this.i18nService.t('valueCopied', this.i18nService.t('password')));
this.platformUtilsService.showToast('info', null,
this.i18nService.t('valueCopied', this.i18nService.t('password')));
}
}