The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: show dialog to prevent restoring larger projects to nano compute (#51309)
Chris Gwilliamsccb1c6016641
diff --git a/apps/studio/components/interfaces/Project/ResumeProjectButton.tsx b/apps/studio/components/interfaces/Project/ResumeProjectButton.tsxindex ff15784db1f..281f70a41cc 100644--- a/apps/studio/components/interfaces/Project/ResumeProjectButton.tsx+++ b/apps/studio/components/interfaces/Project/ResumeProjectButton.tsx@@ -1,6 +1,7 @@import { zodResolver } from '@hookform/resolvers/zod'import { PermissionAction } from '@supabase/shared-types/out/constants'import { useFlag, useParams } from 'common'+import Link from 'next/link'import { useRouter } from 'next/router'import { useMemo, useRef, useState, type ComponentPropsWithoutRef } from 'react'import { useForm } from 'react-hook-form'@@ -80,6 +81,7 @@ export const ResumeProjectButton = ({const [showConfirmRestore, setShowConfirmRestore] = useState(false)const [showFreeProjectLimitWarning, setShowFreeProjectLimitWarning] = useState(false)+ const [billingBlockReason, setBillingBlockReason] = useState<string>()const { can: canResumeProject } = useAsyncCheckPermissions(PermissionAction.INFRA_EXECUTE,@@ -92,6 +94,14 @@ export const ResumeProjectButton = ({toast.success('Restoring project, project will be ready in a few minutes')await router.push(`/project/${variables.ref}`)},+ onError: (error) => {+ // 402s from restore (unpaid invoices, restrictions, Free Plan limits) are all resolved from billing+ if (error.code === 402) {+ setShowConfirmRestore(false)+ return setBillingBlockReason(error.message)+ }+ toast.error(`Failed to restore project: ${error.message}`)+ },})const form = useForm<z.infer<typeof FormSchema>>({@@ -225,7 +235,7 @@ export const ResumeProjectButton = ({open={showFreeProjectLimitWarning}onOpenChange={() => setShowFreeProjectLimitWarning(false)}>- <DialogContent size="medium" className="gap-0 pb-0">+ <DialogContent size="medium" className="gap-0 pb-0" aria-describedby={undefined}><DialogHeader className="border-b"><DialogTitle className="leading-normal">Your organization has members who have exceeded their free project limits@@ -256,6 +266,25 @@ export const ResumeProjectButton = ({</DialogFooter></DialogContent></Dialog>++ <Dialog open={!!billingBlockReason} onOpenChange={() => setBillingBlockReason(undefined)}>+ <DialogContent size="small" aria-describedby={undefined} className="gap-0 pb-0">+ <DialogHeader className="border-b">+ <DialogTitle>Unable to resume project</DialogTitle>+ </DialogHeader>+ <DialogSection className="text-sm text-foreground-light">+ {billingBlockReason}+ </DialogSection>+ <DialogFooter>+ <Button variant="default" onClick={() => setBillingBlockReason(undefined)}>+ Cancel+ </Button>+ <Button asChild variant="primary">+ <Link href={`/org/${orgSlug}/billing`}>Go to billing</Link>+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog></>)}