From a421acc47a92b833ffc26f99b39113f7685892bd Mon Sep 17 00:00:00 2001 From: cyprain-okeke <108260115+cyprain-okeke@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:05:21 +0100 Subject: [PATCH] Resolve the vault page redirect issue (#14941) --- .../payment-method/organization-payment-method.component.ts | 5 +++++ apps/web/src/app/billing/services/trial-flow.service.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts b/apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts index fbd7453c712..bcc497113eb 100644 --- a/apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts +++ b/apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts @@ -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; } diff --git a/apps/web/src/app/billing/services/trial-flow.service.ts b/apps/web/src/app/billing/services/trial-flow.service.ts index 979fc29aed7..81bcf8dcabd 100644 --- a/apps/web/src/app/billing/services/trial-flow.service.ts +++ b/apps/web/src/app/billing/services/trial-flow.service.ts @@ -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 }, }); }