mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix catalog and thread onChallengeVerification
This commit is contained in:
@@ -41,6 +41,8 @@ const Board = () => {
|
||||
const commentRef = useRef();
|
||||
const linkRef = useRef();
|
||||
|
||||
const onChallengeVerificationRef = useRef();
|
||||
|
||||
const [isReplyOpen, setIsReplyOpen] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
const [prevScrollPos, setPrevScrollPos] = useState(0);
|
||||
@@ -92,12 +94,10 @@ const Board = () => {
|
||||
};
|
||||
|
||||
|
||||
const onChallengeVerificationRef = useRef();
|
||||
|
||||
const onChallengeVerification = (challengeVerification) => {
|
||||
if (challengeVerification.challengeSuccess === true) {
|
||||
setSuccessMessage('challenge success', {publishedCid: challengeVerification.publication.cid});
|
||||
navigate(`/p/${selectedAddress}/c/${challengeVerification.publication.cid}`);
|
||||
setSuccessMessage('challenge success', {publishedCid: challengeVerification.publication?.cid});
|
||||
navigate(`/p/${selectedAddress}/c/${challengeVerification.publication?.cid}`);
|
||||
}
|
||||
else if (challengeVerification.challengeSuccess === false) {
|
||||
setErrorMessage('challenge failed', {reason: challengeVerification.reason, errors: challengeVerification.errors});
|
||||
@@ -105,6 +105,7 @@ const Board = () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
onChallengeVerificationRef.current = onChallengeVerification;
|
||||
|
||||
|
||||
@@ -142,6 +143,7 @@ const Board = () => {
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||
...prevPublishCommentOptions,
|
||||
|
||||
Reference in New Issue
Block a user