Skip to content

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

Scaffold success state logic

Joshen Lim855b75034682
diff --git a/studio/components/interfaces/Billing/ProUpgrade.tsx b/studio/components/interfaces/Billing/ProUpgrade.tsx
index dd0a91482f6..164d859021d 100644
--- a/studio/components/interfaces/Billing/ProUpgrade.tsx
+++ b/studio/components/interfaces/Billing/ProUpgrade.tsx
@@ -58,6 +58,7 @@ const ProUpgrade: FC<Props> = ({
const [isRefreshingPreview, setIsRefreshingPreview] = useState(false)
const [isSubmitting, setIsSubmitting] = useState(false)
+ const [isSuccessful, setIsSuccessful] = useState(false)
const [showAddPaymentMethodModal, setShowAddPaymentMethodModal] = useState(false)
const [showSpendCapHelperModal, setShowSpendCapHelperModal] = useState(false)
@@ -161,11 +162,20 @@ const ProUpgrade: FC<Props> = ({
message: `Failed to update subscription: ${res?.error?.message}`,
})
} else {
+ setIsSuccessful(true)
+ ui.setNotification({
+ category: 'success',
+ message: 'Done',
+ })
console.log('Succesfully updated subscription')
}
setIsSubmitting(false)
}
+ if (!isSubmitting && isSuccessful) {
+ return <div className="">Some success state here to be done</div>
+ }
+
return (
<>
<Transition