From 51a2ec393c3174a2a3ed477431c748e4b9955692 Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Mon, 16 Sep 2024 14:08:01 -0400 Subject: [PATCH] [PM-11693] Restoring/permanently deleting item from View item page takes you to Vault page (#10995) * route to trash after restore or delete * route to trash after restore or delete --- .../popup/components/vault-v2/view-v2/view-v2.component.ts | 5 +++-- .../trash-list-items-container.component.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts index 1505d98ede..4025beb685 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts @@ -152,7 +152,8 @@ export class ViewV2Component { return false; } - await this.router.navigate(["/vault"]); + const successRoute = this.cipher.isDeleted ? "/trash" : "/vault"; + await this.router.navigate([successRoute]); this.toastService.showToast({ variant: "success", title: null, @@ -169,7 +170,7 @@ export class ViewV2Component { this.logService.error(e); } - await this.router.navigate(["/vault"]); + await this.router.navigate(["/trash"]); this.toastService.showToast({ variant: "success", title: null, diff --git a/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts b/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts index 6d3bfc2483..de9d95aab0 100644 --- a/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts +++ b/apps/browser/src/vault/popup/settings/trash-list-items-container/trash-list-items-container.component.ts @@ -58,7 +58,7 @@ export class TrashListItemsContainerComponent { try { await this.cipherService.restoreWithServer(cipher.id); - await this.router.navigate(["/vault"]); + await this.router.navigate(["/trash"]); this.toastService.showToast({ variant: "success", title: null, @@ -89,7 +89,7 @@ export class TrashListItemsContainerComponent { try { await this.cipherService.deleteWithServer(cipher.id); - await this.router.navigate(["/vault"]); + await this.router.navigate(["/trash"]); this.toastService.showToast({ variant: "success", title: null,