mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
[Soft Delete] - Added trash and related functionality to web vault
This commit is contained in:
34
src/app/vault/bulk-restore.component.ts
Normal file
34
src/app/vault/bulk-restore.component.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
Input,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
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 analytics: Angulartics2, 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.analytics.eventTrack.next({ action: 'Bulk Restored Items' });
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('restoredItems'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user