Skip to content

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

Adds new api fields

Terry Suttonb0cc68339f09
diff --git a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
index c8a1f10e6a9..42100fff1d0 100644
--- a/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
+++ b/studio/components/layouts/ProjectLayout/ProjectPausedState.tsx
@@ -16,8 +16,12 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
const { ref } = router.query
const { ui } = useStore()
const subscriptionStats = useSubscriptionStats()
+ const {
+ total_free_projects: totalFreeProjects,
+ total_active_free_projects: totalActiveFreeProjects,
+ total_paused_free_projects: totalPausedFreeProjects,
+ } = subscriptionStats
const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT
- console.log(subscriptionStats)
return (
<>
@@ -54,18 +58,24 @@ const ProjectPausedState: FC<Props> = ({ project }) => {
</Link>
</div>
- <div className="mt-4 flex gap-4 border-t pt-8">
- <IconAlertCircle className="text-red-900" size={35} strokeWidth={2} />
- <div>
- <p className="text-md">
- Your account can only have <u>{freeProjectsLimit} free projects.</u>
- </p>
- <p className="text-scale-900 mt-2 text-sm">
- To restore this project you'll need to pause or delete an existing free project
- first.
- </p>
+ {totalActiveFreeProjects > totalFreeProjects ? (
+ <div className="mt-4 flex gap-4 border-t pt-8">
+ <IconAlertCircle className="text-red-900" size={35} strokeWidth={2} />
+ <div>
+ <p className="text-md">
+ Your account can only have <u>{freeProjectsLimit} free projects.</u>
+ </p>
+ <p className="text-scale-900 mt-2 text-sm">
+ To restore this project you'll need to pause or delete an existing free
+ project.
+ </p>
+ </div>
</div>
- </div>
+ ) : (
+ <p className="text-scale-900 mt-4 text-sm">
+ Restore this project and get back to building the next big thing!
+ </p>
+ )}
</div>
</div>
</div>
diff --git a/studio/pages/new/[slug].tsx b/studio/pages/new/[slug].tsx
index 5c166f77741..c32a1820e91 100644
--- a/studio/pages/new/[slug].tsx
+++ b/studio/pages/new/[slug].tsx
@@ -59,7 +59,7 @@ const Wizard: NextPageWithLayout = () => {
const currentOrg = organizations.find((o: any) => o.slug === slug)
const stripeCustomerId = currentOrg?.stripe_customer_id
- const totalFreeProjects = subscriptionStats.total_free_projects
+ const totalFreeProjects = subscriptionStats.total_active_free_projects
const freeProjectsLimit = ui.profile?.free_project_limit ?? DEFAULT_FREE_PROJECTS_LIMIT
const isOrganizationOwner = currentOrg?.is_owner || !app.organizations.isInitialized