1
0
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:
Chad Scharf
2020-04-13 10:26:11 -04:00
parent b8b3c01d68
commit 4116302965
6 changed files with 116 additions and 7 deletions

View File

@@ -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();
}