Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix confirm downgrade modal in billing not closing when free tier limit modal is triggered

Joshen Limbd6a85d21487
diff --git a/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddPaymentMethodForm.tsx b/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddPaymentMethodForm.tsx
index 85ca67df633..3f99f6cc384 100644
--- a/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddPaymentMethodForm.tsx
+++ b/studio/components/interfaces/Billing/AddNewPaymentMethodModal/AddPaymentMethodForm.tsx
@@ -2,8 +2,6 @@ import { FC, useState } from 'react'
import { Button, Modal } from '@supabase/ui'
import { useStripe, useElements, PaymentElement } from '@stripe/react-stripe-js'
-import { useStore } from 'hooks'
-
interface Props {
returnUrl: string
onCancel: () => void
@@ -14,9 +12,6 @@ interface Props {
// Small UX annoyance here, that the page will be refreshed
const AddPaymentMethodForm: FC<Props> = ({ returnUrl, onCancel }) => {
- const { ui } = useStore()
- const projectRef = ui.selectedProject?.ref ?? ''
-
const stripe = useStripe()
const elements = useElements()
diff --git a/studio/pages/project/[ref]/settings/billing/update/index.tsx b/studio/pages/project/[ref]/settings/billing/update/index.tsx
index f654ef98708..3faa1d8e0a8 100644
--- a/studio/pages/project/[ref]/settings/billing/update/index.tsx
+++ b/studio/pages/project/[ref]/settings/billing/update/index.tsx
@@ -89,6 +89,7 @@ const BillingUpdate: NextPage = () => {
const onConfirmDowngrade = () => {
if (freeProjectsOwned >= freeProjectsLimit) {
setShowDowngradeError(true)
+ setShowConfirmDowngrade(false)
setSelectedPlan(undefined)
} else {
router.push(`/project/${projectRef}/settings/billing/update/free`)