fix captcha image state

This commit is contained in:
Tom
2023-05-27 14:09:49 +02:00
parent d04dd32d5a
commit 0b877ec179
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -7,7 +7,7 @@ import Draggable from 'react-draggable';
const CaptchaModal = () => {
const {
challengesArray,
challengesArray, setChallengesArray,
pendingComment,
selectedStyle,
setCaptchaResponse,
@@ -83,6 +83,8 @@ const CaptchaModal = () => {
const submitCaptcha = (callback) => {
setCaptchaResponse(responseRef.current.value);
setImageSources([]);
setChallengesArray([]);
setIsCaptchaOpen(false);
if (callback) {
@@ -96,6 +98,8 @@ const CaptchaModal = () => {
isOpen={isCaptchaOpen}
onRequestClose={() => {
submitCaptcha();
setImageSources([]);
setChallengesArray([]);
setIsCaptchaOpen(false);}}
contentLabel="Captcha Modal"
shouldCloseOnEsc={false}
@@ -167,7 +171,7 @@ const CaptchaModal = () => {
}
}}
>
{currentChallengeIndex + 1 < totalChallenges ? "Next" : "Post"}
{currentChallengeIndex + 1 < totalChallenges ? "Next" : "Submit"}
</button>
</div>
</div>
@@ -84,7 +84,7 @@ export const StyledModal = styled(Modal)`
#nav {
float: right;
margin: 0;
width: 40px;
width: auto;
}
${({ selectedStyle }) => {