1
0
mirror of https://github.com/bitwarden/web synced 2026-01-06 18:43:18 +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

@@ -6,8 +6,6 @@ import {
Output,
} from '@angular/core';
import { ToasterService } from 'angular2-toaster';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { EventService } from 'jslib-common/abstractions/event.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
@@ -49,7 +47,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
private pagedCiphersCount = 0;
private refreshing = false;
constructor(searchService: SearchService, protected toasterService: ToasterService,
constructor(searchService: SearchService,
protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
protected cipherService: CipherService, protected eventService: EventService,
protected totpService: TotpService, protected userService: UserService,
@@ -156,7 +154,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
try {
this.actionPromise = this.deleteCipher(c.id, permanent);
await this.actionPromise;
this.toasterService.popAsync('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem'
this.platformUtilsService.showToast('success', null, this.i18nService.t(permanent ? 'permanentlyDeletedItem'
: 'deletedItem'));
this.refresh();
} catch (e) {
@@ -180,7 +178,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
try {
this.actionPromise = this.cipherService.restoreWithServer(c.id);
await this.actionPromise;
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItem'));
this.platformUtilsService.showToast('success', null, this.i18nService.t('restoredItem'));
this.refresh();
} catch (e) {
this.logService.error(e);
@@ -204,7 +202,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnDestroy
}
this.platformUtilsService.copyToClipboard(value, { window: window });
this.toasterService.popAsync('info', null,
this.platformUtilsService.showToast('info', null,
this.i18nService.t('valueCopied', this.i18nService.t(typeI18nKey)));
if (typeI18nKey === 'password' || typeI18nKey === 'verificationCodeTotp') {