Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(useCaptchaModal): The first time `captcha_error` is encountered it is validated directly.

haitaoo3880eab449e3
diff --git a/ui/src/hooks/useCaptchaModal/index.tsx b/ui/src/hooks/useCaptchaModal/index.tsx
index 170f076e..e61242c2 100644
--- a/ui/src/hooks/useCaptchaModal/index.tsx
+++ b/ui/src/hooks/useCaptchaModal/index.tsx
@@ -107,6 +107,7 @@ const Index = (captchaKey: CaptchaKey) => {
});
}
fetchCaptchaData();
+ show();
} else {
setImgCode({
...ri,
@@ -238,6 +239,7 @@ const Index = (captchaKey: CaptchaKey) => {
refCallback.current = submitFunc;
if (captcha?.verify) {
show();
+ return false;
}
return submitFunc();
},