fix submit a challenge pressing enter

This commit is contained in:
plebeius.eth
2023-09-09 22:37:51 +02:00
parent 48a0f36f41
commit b9c9d27a6c
+4 -2
View File
@@ -37,7 +37,6 @@ const CaptchaModal = () => {
}, [isCaptchaOpen, setIsAuthorDelete, setIsAuthorEdit, setIsModEdit]);
useEffect(() => {
const handleResize = () => setIsMobile(window.innerWidth <= 480);
window.addEventListener('resize', handleResize);
@@ -71,7 +70,10 @@ const CaptchaModal = () => {
const handleKeyDown = (event) => {
if (event.key === "Enter") {
event.preventDefault();
submitCaptcha();
submitCaptcha((response) => {
setCaptchaResponse(response);
resolveCaptchaPromise(response);
});
}
};