diff --git a/apps/web/src/app/(dashboard)/settings/billing/billing-plans.tsx b/apps/web/src/app/(dashboard)/settings/billing/billing-plans.tsx index 6d4b350dd..537a0c97b 100644 --- a/apps/web/src/app/(dashboard)/settings/billing/billing-plans.tsx +++ b/apps/web/src/app/(dashboard)/settings/billing/billing-plans.tsx @@ -44,11 +44,11 @@ export const BillingPlans = ({ prices }: BillingPlansProps) => { const isMounted = useIsMounted(); const [interval, setInterval] = useState('month'); - const [isFetchingCheckoutSession, setIsFetchingCheckoutSession] = useState(false); + const [checkoutSessionPriceId, setCheckoutSessionPriceId] = useState(null); const onSubscribeClick = async (priceId: string) => { try { - setIsFetchingCheckoutSession(true); + setCheckoutSessionPriceId(priceId); const url = await createCheckout({ priceId }); @@ -64,7 +64,7 @@ export const BillingPlans = ({ prices }: BillingPlansProps) => { variant: 'destructive', }); } finally { - setIsFetchingCheckoutSession(false); + setCheckoutSessionPriceId(null); } }; @@ -122,7 +122,8 @@ export const BillingPlans = ({ prices }: BillingPlansProps) => {