fix captcha modal state

This commit is contained in:
Tom
2023-05-30 16:41:37 +02:00
parent 083fceae81
commit dee9e198cc
+9 -5
View File
@@ -92,15 +92,19 @@ const CaptchaModal = () => {
}
};
const handleCloseModal = () => {
setImageSources([]);
setChallengesArray([]);
setIsCaptchaOpen(false);
};
return (
<StyledModal
isOpen={isCaptchaOpen}
onRequestClose={() => {
submitCaptcha();
setImageSources([]);
setChallengesArray([]);
setIsCaptchaOpen(false);}}
handleCloseModal();
submitCaptcha();}}
contentLabel="Captcha Modal"
shouldCloseOnEsc={false}
shouldCloseOnOverlayClick={false}
@@ -115,7 +119,7 @@ const CaptchaModal = () => {
pendingComment.parentCid ?
("Challenges for Reply to c/" + selectedShortCid) :
"Challenges for New Thread"}
<button className="icon" onClick={() => setIsCaptchaOpen(false)} title="close" />
<button className="icon" onClick={() => handleCloseModal()} title="close" />
</div>
<div id="form">
{pendingComment.author?.displayName ? (