mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix captcha image state
This commit is contained in:
@@ -7,7 +7,7 @@ import Draggable from 'react-draggable';
|
|||||||
|
|
||||||
const CaptchaModal = () => {
|
const CaptchaModal = () => {
|
||||||
const {
|
const {
|
||||||
challengesArray,
|
challengesArray, setChallengesArray,
|
||||||
pendingComment,
|
pendingComment,
|
||||||
selectedStyle,
|
selectedStyle,
|
||||||
setCaptchaResponse,
|
setCaptchaResponse,
|
||||||
@@ -83,6 +83,8 @@ const CaptchaModal = () => {
|
|||||||
|
|
||||||
const submitCaptcha = (callback) => {
|
const submitCaptcha = (callback) => {
|
||||||
setCaptchaResponse(responseRef.current.value);
|
setCaptchaResponse(responseRef.current.value);
|
||||||
|
setImageSources([]);
|
||||||
|
setChallengesArray([]);
|
||||||
setIsCaptchaOpen(false);
|
setIsCaptchaOpen(false);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
@@ -96,6 +98,8 @@ const CaptchaModal = () => {
|
|||||||
isOpen={isCaptchaOpen}
|
isOpen={isCaptchaOpen}
|
||||||
onRequestClose={() => {
|
onRequestClose={() => {
|
||||||
submitCaptcha();
|
submitCaptcha();
|
||||||
|
setImageSources([]);
|
||||||
|
setChallengesArray([]);
|
||||||
setIsCaptchaOpen(false);}}
|
setIsCaptchaOpen(false);}}
|
||||||
contentLabel="Captcha Modal"
|
contentLabel="Captcha Modal"
|
||||||
shouldCloseOnEsc={false}
|
shouldCloseOnEsc={false}
|
||||||
@@ -167,7 +171,7 @@ const CaptchaModal = () => {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{currentChallengeIndex + 1 < totalChallenges ? "Next" : "Post"}
|
{currentChallengeIndex + 1 < totalChallenges ? "Next" : "Submit"}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export const StyledModal = styled(Modal)`
|
|||||||
#nav {
|
#nav {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 40px;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
${({ selectedStyle }) => {
|
${({ selectedStyle }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user