From 803b0a5ecdb46c87af036eb8a0a2ec174c345e04 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 2 Jun 2025 16:38:03 +0100 Subject: [PATCH] Update subscription check --- src/components/Billing/UpgradeAccountModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Billing/UpgradeAccountModal.tsx b/src/components/Billing/UpgradeAccountModal.tsx index 63dda64d9..4192bf63f 100644 --- a/src/components/Billing/UpgradeAccountModal.tsx +++ b/src/components/Billing/UpgradeAccountModal.tsx @@ -120,10 +120,11 @@ export function UpgradeAccountModal(props: UpgradeAccountModalProps) { queryClient, ); + const isCanceled = userBillingDetails?.status === 'canceled'; const selectedPlanDetails = USER_SUBSCRIPTION_PLAN_PRICES.find( (plan) => plan.interval === selectedPlan, ); - const currentPlanPriceId = userBillingDetails?.priceId; + const currentPlanPriceId = isCanceled ? null : userBillingDetails?.priceId; const currentPlan = USER_SUBSCRIPTION_PLAN_PRICES.find( (plan) => plan.priceId === currentPlanPriceId, ); @@ -202,9 +203,8 @@ export function UpgradeAccountModal(props: UpgradeAccountModalProps) {
{USER_SUBSCRIPTION_PLAN_PRICES.map((plan) => { - const isCanceled = userBillingDetails?.status === 'canceled'; const isCurrentPlanSelected = - currentPlan?.priceId === plan.priceId && !isCanceled; + currentPlan?.priceId === plan.priceId; const isYearly = plan.interval === 'year'; return (