1
0
mirror of https://github.com/bitwarden/web synced 2026-01-01 16:13:15 +00:00
Files
web/src/app/vault/bulk-restore.component.ts
Oscar Hinton a9ef011cf3 Remove dead code (#930)
* Remove last remnants of old analytics code
2021-04-14 23:43:40 +02:00

33 lines
943 B
TypeScript

import {
Component,
EventEmitter,
Input,
Output,
} from '@angular/core';
import { ToasterService } from 'angular2-toaster';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
@Component({
selector: 'app-vault-bulk-restore',
templateUrl: 'bulk-restore.component.html',
})
export class BulkRestoreComponent {
@Input() cipherIds: string[] = [];
@Output() onRestored = new EventEmitter();
formPromise: Promise<any>;
constructor(private cipherService: CipherService, private toasterService: ToasterService,
private i18nService: I18nService) { }
async submit() {
this.formPromise = this.cipherService.restoreManyWithServer(this.cipherIds);
await this.formPromise;
this.onRestored.emit();
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItems'));
}
}