mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
updated components for setResolveCaptchaPromise
This commit is contained in:
@@ -15,6 +15,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
|||||||
setChallengesArray,
|
setChallengesArray,
|
||||||
setIsCaptchaOpen,
|
setIsCaptchaOpen,
|
||||||
setPendingComment,
|
setPendingComment,
|
||||||
|
setResolveCaptchaPromise,
|
||||||
selectedAddress,
|
selectedAddress,
|
||||||
selectedParentCid,
|
selectedParentCid,
|
||||||
selectedShortCid,
|
selectedShortCid,
|
||||||
@@ -40,7 +41,7 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
|||||||
|
|
||||||
const onChallengeVerification = (challengeVerification) => {
|
const onChallengeVerification = (challengeVerification) => {
|
||||||
if (challengeVerification.challengeSuccess === true) {
|
if (challengeVerification.challengeSuccess === true) {
|
||||||
console.log('challenge success:', challengeVerification);
|
return;
|
||||||
}
|
}
|
||||||
else if (challengeVerification.challengeSuccess === false) {
|
else if (challengeVerification.challengeSuccess === false) {
|
||||||
setErrorMessage('challenge failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
|
setErrorMessage('challenge failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
|
||||||
@@ -153,6 +154,8 @@ const ReplyModal = ({ isOpen, closeModal }) => {
|
|||||||
|
|
||||||
setCaptchaResponse('');
|
setCaptchaResponse('');
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
useGeneralStore.getState().setResolveCaptchaPromise(resolve);
|
||||||
};
|
};
|
||||||
|
|
||||||
challengeImg.onerror = () => {
|
challengeImg.onerror = () => {
|
||||||
|
|||||||
@@ -193,7 +193,6 @@ const Board = () => {
|
|||||||
if (event.key === 'Enter') {
|
if (event.key === 'Enter') {
|
||||||
const currentCaptchaResponse = useGeneralStore.getState().captchaResponse;
|
const currentCaptchaResponse = useGeneralStore.getState().captchaResponse;
|
||||||
resolve(currentCaptchaResponse);
|
resolve(currentCaptchaResponse);
|
||||||
console.log('captcha response', currentCaptchaResponse)
|
|
||||||
setIsCaptchaOpen(false);
|
setIsCaptchaOpen(false);
|
||||||
document.removeEventListener('keydown', handleKeyDown);
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -203,7 +202,7 @@ const Board = () => {
|
|||||||
setCaptchaResponse('');
|
setCaptchaResponse('');
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
useGeneralStore.getState().setResolveCaptchaPromise(resolve);
|
setResolveCaptchaPromise(resolve);
|
||||||
};
|
};
|
||||||
|
|
||||||
challengeImg.onerror = () => {
|
challengeImg.onerror = () => {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const Catalog = () => {
|
|||||||
setIsCaptchaOpen,
|
setIsCaptchaOpen,
|
||||||
isSettingsOpen, setIsSettingsOpen,
|
isSettingsOpen, setIsSettingsOpen,
|
||||||
setPendingComment,
|
setPendingComment,
|
||||||
|
setResolveCaptchaPromise,
|
||||||
selectedAddress, setSelectedAddress,
|
selectedAddress, setSelectedAddress,
|
||||||
selectedStyle,
|
selectedStyle,
|
||||||
setSelectedThread,
|
setSelectedThread,
|
||||||
@@ -183,6 +184,8 @@ const Catalog = () => {
|
|||||||
|
|
||||||
setCaptchaResponse('');
|
setCaptchaResponse('');
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
setResolveCaptchaPromise(resolve);
|
||||||
};
|
};
|
||||||
|
|
||||||
challengeImg.onerror = () => {
|
challengeImg.onerror = () => {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const Thread = () => {
|
|||||||
defaultSubplebbits,
|
defaultSubplebbits,
|
||||||
setIsCaptchaOpen,
|
setIsCaptchaOpen,
|
||||||
isSettingsOpen, setIsSettingsOpen,
|
isSettingsOpen, setIsSettingsOpen,
|
||||||
|
setResolveCaptchaPromise,
|
||||||
pendingComment, setPendingComment,
|
pendingComment, setPendingComment,
|
||||||
selectedAddress, setSelectedAddress,
|
selectedAddress, setSelectedAddress,
|
||||||
setSelectedParentCid,
|
setSelectedParentCid,
|
||||||
@@ -92,7 +93,7 @@ const Thread = () => {
|
|||||||
|
|
||||||
const onChallengeVerification = (challengeVerification) => {
|
const onChallengeVerification = (challengeVerification) => {
|
||||||
if (challengeVerification.challengeSuccess === true) {
|
if (challengeVerification.challengeSuccess === true) {
|
||||||
setSuccessMessage('challenge success', {publishedCid: challengeVerification.publication?.cid});
|
return;
|
||||||
}
|
}
|
||||||
else if (challengeVerification.challengeSuccess === false) {
|
else if (challengeVerification.challengeSuccess === false) {
|
||||||
setErrorMessage('challenge failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
|
setErrorMessage('challenge failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
|
||||||
@@ -204,6 +205,8 @@ const Thread = () => {
|
|||||||
|
|
||||||
setCaptchaResponse('');
|
setCaptchaResponse('');
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
setResolveCaptchaPromise(resolve);
|
||||||
};
|
};
|
||||||
|
|
||||||
challengeImg.onerror = () => {
|
challengeImg.onerror = () => {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ function handleAddressClick(shortAddress) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (matchingElements.length === 0) {
|
if (matchingElements.length === 0) {
|
||||||
console.log('Could not find any matching elements');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function handleQuoteClick(reply, parentCid, threadCid) {
|
|||||||
if (opElement) {
|
if (opElement) {
|
||||||
opElement.scrollIntoView({ behavior: "auto", block: "start" });
|
opElement.scrollIntoView({ behavior: "auto", block: "start" });
|
||||||
} else {
|
} else {
|
||||||
console.log('Could not find OP element');
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -49,7 +49,7 @@ function handleQuoteClick(reply, parentCid, threadCid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('Could not find target element');
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user