From 649964f26bc29b23b3fad4144b4ac5a9ca3140c8 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 26 Apr 2023 14:24:08 +0200 Subject: [PATCH] revert to fix hooks deps --- src/components/ReplyModal.jsx | 4 ++-- src/components/views/Board.jsx | 4 ++-- src/components/views/Catalog.jsx | 4 ++-- src/components/views/Thread.jsx | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/ReplyModal.jsx b/src/components/ReplyModal.jsx index a0d33d48..0a53a9cd 100644 --- a/src/components/ReplyModal.jsx +++ b/src/components/ReplyModal.jsx @@ -83,7 +83,7 @@ const ReplyModal = ({ isOpen, closeModal }) => { if (index !== undefined) { setPendingCommentIndex(index); } - }, [index, location, setPendingCommentIndex]); + }, [index, location]); const resetFields = () => { @@ -122,7 +122,7 @@ const ReplyModal = ({ isOpen, closeModal }) => { closeModal(); })(); } - }, [publishCommentOptions, closeModal, publishComment]); + }, [publishCommentOptions]); const getChallengeAnswersFromUser = async (challenges) => { diff --git a/src/components/views/Board.jsx b/src/components/views/Board.jsx index cd85a636..e685109d 100644 --- a/src/components/views/Board.jsx +++ b/src/components/views/Board.jsx @@ -207,7 +207,7 @@ const Board = () => { setPendingCommentIndex(index); navigate(`/profile/c/${index}`); } - }, [index, navigate, setPendingCommentIndex]); + }, [index]); const resetFields = () => { @@ -248,7 +248,7 @@ const Board = () => { resetFields(); })(); } - }, [publishCommentOptions, publishComment]); + }, [publishCommentOptions]); const getChallengeAnswersFromUser = async (challenges) => { diff --git a/src/components/views/Catalog.jsx b/src/components/views/Catalog.jsx index 218b8e7f..166e4837 100644 --- a/src/components/views/Catalog.jsx +++ b/src/components/views/Catalog.jsx @@ -133,7 +133,7 @@ const Catalog = () => { setPendingCommentIndex(index); navigate(`/profile/c/${index}`); } - }, [index, navigate, setPendingCommentIndex]); + }, [index]); const resetFields = () => { @@ -174,7 +174,7 @@ const Catalog = () => { resetFields(); })(); } - }, [publishCommentOptions, publishComment]); + }, [publishCommentOptions]); const getChallengeAnswersFromUser = async (challenges) => { diff --git a/src/components/views/Thread.jsx b/src/components/views/Thread.jsx index cd2c21d7..a697894a 100644 --- a/src/components/views/Thread.jsx +++ b/src/components/views/Thread.jsx @@ -75,7 +75,7 @@ const Thread = () => { parentCids: [ selectedThread || 'n/a', ...flattenedReplies.map(reply => reply.cid) ] - }), [flattenedReplies, selectedThread]); + }), [flattenedReplies]); const { accountComments } = useAccountComments({filter}); @@ -100,7 +100,7 @@ const Thread = () => { if (selectedSubplebbit) { setSelectedTitle(selectedSubplebbit.title); } - }, [subplebbitAddress, setSelectedAddress, setSelectedTitle, defaultSubplebbits, setSelectedThread, threadCid]); + }, [subplebbitAddress, setSelectedAddress, setSelectedTitle, defaultSubplebbits]); // mobile navbar scroll effect useEffect(() => { @@ -167,7 +167,7 @@ const Thread = () => { if (index !== undefined) { setPendingCommentIndex(index); } - }, [index, setPendingCommentIndex]); + }, [index]); const resetFields = () => { @@ -205,7 +205,7 @@ const Thread = () => { resetFields(); })(); } - }, [publishCommentOptions, publishComment]); + }, [publishCommentOptions]); const getChallengeAnswersFromUser = async (challenges) => {