mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[Soft Delete] - Trash bin in browser extension
This commit is contained in:
@@ -60,11 +60,17 @@ export class ViewComponent extends BaseViewComponent {
|
||||
}
|
||||
|
||||
edit() {
|
||||
if (this.cipher.isDeleted) {
|
||||
return false;
|
||||
}
|
||||
super.edit();
|
||||
this.router.navigate(['/edit-cipher'], { queryParams: { cipherId: this.cipher.id } });
|
||||
}
|
||||
|
||||
clone() {
|
||||
if (this.cipher.isDeleted) {
|
||||
return false;
|
||||
}
|
||||
super.clone();
|
||||
this.router.navigate(['/clone-cipher'], {
|
||||
queryParams: {
|
||||
@@ -74,6 +80,25 @@ export class ViewComponent extends BaseViewComponent {
|
||||
});
|
||||
}
|
||||
|
||||
async restore() {
|
||||
if (!this.cipher.isDeleted) {
|
||||
return false;
|
||||
}
|
||||
if (await super.restore()) {
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async delete() {
|
||||
if (await super.delete()) {
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
close() {
|
||||
this.location.back();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user