mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 06:39:09 +03:00
Change loading logic for when hcaptcha is involved in payment summary panel enterprise
This commit is contained in:
1 parent
773403b4ab
commit
ebed18fcfe
2 files changed
+7
-6
No files matched your search
@@ -139,10 +139,14 @@ const EnterpriseUpdate: FC<Props> = ({
|
||||
|
||||
// Last todo to support enterprise billing on dashboard + E2E test
|
||||
const onConfirmPayment = async () => {
|
||||
let token = captchaToken
|
||||
setIsSubmitting(true)
|
||||
|
||||
const token =
|
||||
captchaToken ?? (await captchaRef.current?.execute({ async: true }))?.response ?? undefined
|
||||
|
||||
if (!token) {
|
||||
const captchaResponse = await captchaRef.current?.execute({ async: true })
|
||||
token = captchaResponse?.response ?? null
|
||||
setIsSubmitting(false)
|
||||
return
|
||||
}
|
||||
|
||||
const payload = {
|
||||
@@ -157,8 +161,6 @@ const EnterpriseUpdate: FC<Props> = ({
|
||||
),
|
||||
tier: currentSubscription.tier.price_id,
|
||||
}
|
||||
|
||||
setIsSubmitting(true)
|
||||
const res = await patch(`${API_URL}/projects/${projectRef}/subscription`, payload)
|
||||
resetCaptcha()
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ const ProUpgrade: FC<Props> = ({
|
||||
token ?? undefined
|
||||
)
|
||||
const res = await patch(`${API_URL}/projects/${projectRef}/subscription`, payload)
|
||||
|
||||
resetCaptcha()
|
||||
|
||||
if (res?.error) {
|
||||
|
||||
Reference in new issue
Block a user