add setPendingCommentIndex

This commit is contained in:
plebbitor
2023-04-24 15:48:30 +02:00
parent 04cdd9f445
commit 661f925f07
9 changed files with 41 additions and 4 deletions
+6 -1
View File
@@ -33,6 +33,7 @@ const Thread = () => {
isSettingsOpen, setIsSettingsOpen,
setResolveCaptchaPromise,
pendingComment, setPendingComment,
setPendingCommentIndex,
selectedAddress, setSelectedAddress,
setSelectedParentCid,
setSelectedShortCid,
@@ -137,7 +138,7 @@ const Thread = () => {
useEffect(() => {
if (index !== undefined) {
window.scrollTo(0, document.body.scrollHeight);
setPendingCommentIndex(index);
}
}, [index]);
@@ -151,6 +152,10 @@ const Thread = () => {
const handleSubmit = async (event) => {
event.preventDefault();
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight);
}, 100)
setPublishCommentOptions((prevPublishCommentOptions) => ({
...prevPublishCommentOptions,