From 8fb7c5c988ec2a321c7bb8946265fc3be1ec1c21 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:40:21 +0000 Subject: [PATCH] Refactor: Optimize Captcha Loading --- index.html | 3 +++ src/components/auth/TurnstileCaptcha.tsx | 24 +++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index e98bcf59..95501ad4 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,9 @@ + + + diff --git a/src/components/auth/TurnstileCaptcha.tsx b/src/components/auth/TurnstileCaptcha.tsx index 7b020dba..f3735b59 100644 --- a/src/components/auth/TurnstileCaptcha.tsx +++ b/src/components/auth/TurnstileCaptcha.tsx @@ -77,7 +77,7 @@ export function TurnstileCaptcha({ if (loading) { const timeout = setTimeout(() => { setLoading(false); - }, 10000); // 10 second timeout + }, 5000); // 5 second timeout return () => clearTimeout(timeout); } }, [loading]); @@ -95,13 +95,18 @@ export function TurnstileCaptcha({ return (
-
+
+ {loading && ( +
+ Loading CAPTCHA... +
+ )} +
- - {loading && ( -
- - Loading CAPTCHA... -
- )}
{error && (