1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-11 10:10:25 +01:00

[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

View File

@ -33,6 +33,7 @@ import { PopOutComponent } from "../../../../../platform/popup/components/pop-ou
import { PopupFooterComponent } from "../../../../../platform/popup/layout/popup-footer.component"; import { PopupFooterComponent } from "../../../../../platform/popup/layout/popup-footer.component";
import { PopupHeaderComponent } from "../../../../../platform/popup/layout/popup-header.component"; import { PopupHeaderComponent } from "../../../../../platform/popup/layout/popup-header.component";
import { PopupPageComponent } from "../../../../../platform/popup/layout/popup-page.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 { BrowserPremiumUpgradePromptService } from "../../../services/browser-premium-upgrade-prompt.service";
import { VaultPopupAutofillService } from "../../../services/vault-popup-autofill.service"; import { VaultPopupAutofillService } from "../../../services/vault-popup-autofill.service";
@ -77,6 +78,7 @@ export class ViewV2Component {
private vaultPopupAutofillService: VaultPopupAutofillService, private vaultPopupAutofillService: VaultPopupAutofillService,
private accountService: AccountService, private accountService: AccountService,
private eventCollectionService: EventCollectionService, private eventCollectionService: EventCollectionService,
private popupRouterCacheService: PopupRouterCacheService,
) { ) {
this.subscribeToParams(); this.subscribeToParams();
} }
@ -163,8 +165,8 @@ export class ViewV2Component {
return false; return false;
} }
const successRoute = this.cipher.isDeleted ? "/trash" : "/vault"; await this.popupRouterCacheService.back();
await this.router.navigate([successRoute]);
this.toastService.showToast({ this.toastService.showToast({
variant: "success", variant: "success",
title: null, title: null,
@ -181,7 +183,7 @@ export class ViewV2Component {
this.logService.error(e); this.logService.error(e);
} }
await this.router.navigate(["/trash"]); await this.popupRouterCacheService.back();
this.toastService.showToast({ this.toastService.showToast({
variant: "success", variant: "success",
title: null, title: null,