mirror of
https://github.com/bitwarden/web
synced 2025-12-15 07:43:16 +00:00
[Soft Delete] - Added trash and related functionality to web vault
This commit is contained in:
@@ -17,6 +17,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||
})
|
||||
export class BulkDeleteComponent {
|
||||
@Input() cipherIds: string[] = [];
|
||||
@Input() permanent: boolean = false;
|
||||
@Output() onDeleted = new EventEmitter();
|
||||
|
||||
formPromise: Promise<any>;
|
||||
@@ -25,10 +26,12 @@ export class BulkDeleteComponent {
|
||||
private toasterService: ToasterService, private i18nService: I18nService) { }
|
||||
|
||||
async submit() {
|
||||
this.formPromise = this.cipherService.deleteManyWithServer(this.cipherIds);
|
||||
this.formPromise = this.permanent ? this.cipherService.deleteManyWithServer(this.cipherIds) :
|
||||
this.cipherService.softDeleteManyWithServer(this.cipherIds);
|
||||
await this.formPromise;
|
||||
this.onDeleted.emit();
|
||||
this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' });
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedItems'));
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t(this.permanent ? 'permanentlyDeletedItems'
|
||||
: 'deletedItems'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user