[PM-12277] Deleting or restoring from view item page breaks back button (#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
This commit is contained in:
SmithThe4th 2024-09-20 15:31:52 -04:00 committed by GitHub
parent 2b18185b40
commit 9a89ef9b4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -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";
@ -77,6 +78,7 @@ export class ViewV2Component {
private vaultPopupAutofillService: VaultPopupAutofillService,
private accountService: AccountService,
private eventCollectionService: EventCollectionService,
private popupRouterCacheService: PopupRouterCacheService,
) {
this.subscribeToParams();
}
@ -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,
@ -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,