diff --git a/apps/remix/app/components/general/billing-plans.tsx b/apps/remix/app/components/general/billing-plans.tsx index fabfbf6b5..e8d593dc9 100644 --- a/apps/remix/app/components/general/billing-plans.tsx +++ b/apps/remix/app/components/general/billing-plans.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { zodResolver } from '@hookform/resolvers/zod'; import { useLingui } from '@lingui/react/macro'; @@ -97,7 +97,7 @@ export const BillingPlans = ({ {pricesToDisplay.map((price) => { const planId = price.claim.toLowerCase().replace('claim_', ''); - const isSelected = selectedPlan && planId === selectedPlan; + const isSelected = selectedPlan && planId === selectedPlan?.toLowerCase(); return ( { - const [isOpen, setIsOpen] = useState(isSelected && isFromPricingPage); + const [isOpen, setIsOpen] = useState(false); + + useEffect(() => { + if (isSelected && isFromPricingPage) { + setIsOpen(true); + } + }, [isSelected, isFromPricingPage]); const { t } = useLingui(); const { toast } = useToast();