Skip to content

Commit

Permalink
[PM-12277] Deleting or restoring from view item page breaks back butt…
Browse files Browse the repository at this point in the history
…on (#11108)

* Added skipLocationChange while navigating to the view cipher to prevent pushing view cipher route to state

* Fix navigation bug after restore or delete

* Simplified to just use popupRouterCacheService.back
  • Loading branch information
gbubemismith authored Sep 20, 2024
1 parent 2b18185 commit 9a89ef9
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { PopOutComponent } from "../../../../../platform/popup/components/pop-ou
import { PopupFooterComponent } from "../../../../../platform/popup/layout/popup-footer.component";
import { PopupHeaderComponent } from "../../../../../platform/popup/layout/popup-header.component";
import { PopupPageComponent } from "../../../../../platform/popup/layout/popup-page.component";
import { PopupRouterCacheService } from "../../../../../platform/popup/view-cache/popup-router-cache.service";
import { BrowserPremiumUpgradePromptService } from "../../../services/browser-premium-upgrade-prompt.service";
import { VaultPopupAutofillService } from "../../../services/vault-popup-autofill.service";

Expand Down Expand Up @@ -77,6 +78,7 @@ export class ViewV2Component {
private vaultPopupAutofillService: VaultPopupAutofillService,
private accountService: AccountService,
private eventCollectionService: EventCollectionService,
private popupRouterCacheService: PopupRouterCacheService,
) {
this.subscribeToParams();
}
Expand Down Expand Up @@ -163,8 +165,8 @@ export class ViewV2Component {
return false;
}

const successRoute = this.cipher.isDeleted ? "/trash" : "/vault";
await this.router.navigate([successRoute]);
await this.popupRouterCacheService.back();

this.toastService.showToast({
variant: "success",
title: null,
Expand All @@ -181,7 +183,7 @@ export class ViewV2Component {
this.logService.error(e);
}

await this.router.navigate(["/trash"]);
await this.popupRouterCacheService.back();
this.toastService.showToast({
variant: "success",
title: null,
Expand Down

0 comments on commit 9a89ef9

Please sign in to comment.