1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

Resolve the vault page redirect issue (#14941)

This commit is contained in:
cyprain-okeke
2025-06-09 13:05:21 +01:00
committed by GitHub
parent b1f090e054
commit a421acc47a
2 changed files with 6 additions and 0 deletions

View File

@@ -87,6 +87,9 @@ export class OrganizationPaymentMethodComponent implements OnDestroy {
const state = this.router.getCurrentNavigation()?.extras?.state;
// incase the above state is undefined or null we use redundantState
const redundantState: any = location.getState();
const queryParam = this.activatedRoute.snapshot.queryParamMap.get(
"launchPaymentModalAutomatically",
);
if (state && Object.prototype.hasOwnProperty.call(state, "launchPaymentModalAutomatically")) {
this.launchPaymentModalAutomatically = state.launchPaymentModalAutomatically;
} else if (
@@ -94,6 +97,8 @@ export class OrganizationPaymentMethodComponent implements OnDestroy {
Object.prototype.hasOwnProperty.call(redundantState, "launchPaymentModalAutomatically")
) {
this.launchPaymentModalAutomatically = redundantState.launchPaymentModalAutomatically;
} else if (queryParam === "true") {
this.launchPaymentModalAutomatically = true;
} else {
this.launchPaymentModalAutomatically = false;
}

View File

@@ -133,6 +133,7 @@ export class TrialFlowService {
private async navigateToPaymentMethod(orgId: string) {
await this.router.navigate(["organizations", `${orgId}`, "billing", "payment-method"], {
state: { launchPaymentModalAutomatically: true },
queryParams: { launchPaymentModalAutomatically: true },
});
}