Skip to content

Commit b88596e

Browse files
authored
Fixed-recaptcha-onclick-render-JAF (#386) (#387)
2 parents 887a945 + 21c7e57 commit b88596e

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

src/components/JAF/JAF.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ function JAF() {
7474
const accessToken = Cookies.get("accessToken");
7575
const [isLoading, setIsLoading] = useState(true);
7676
const [captchaToken, setCaptchaToken] = useState("");
77-
const [showCaptcha, setShowCaptcha] = useState(false);
7877
const recaptchaRef = useRef<ReCAPTCHA | null>(null);
7978
const [isSubmitting, setIsSubmitting] = useState(false);
8079

@@ -98,7 +97,6 @@ function JAF() {
9897
initialValues={DEFAULT_FORM_VALUES}
9998
onSubmit={async (values: JAFFormValues) => {
10099
if (!captchaToken) {
101-
setShowCaptcha(true);
102100
toast.error("Please complete the CAPTCHA to submit.");
103101
return;
104102
}
@@ -201,7 +199,6 @@ function JAF() {
201199
} finally {
202200
setIsSubmitting(false);
203201
setCaptchaToken("");
204-
setShowCaptcha(false);
205202
recaptchaRef.current?.reset();
206203
}
207204
}}
@@ -254,13 +251,11 @@ function JAF() {
254251
{currentStepIndex === 2 ? (
255252
<Row justify="center" className="pt-6">
256253
<div className="flex flex-col items-center gap-4">
257-
{showCaptcha && (
258254
<ReCAPTCHA
259255
ref={recaptchaRef}
260256
sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY!}
261257
onChange={(token) => setCaptchaToken(token || "")}
262258
/>
263-
)}
264259
<div className="flex gap-2">
265260
<Button
266261
disabled={isPrevDisabled || isSubmitting}

0 commit comments

Comments
 (0)