diff --git a/src/components/NewCommentForm.tsx b/src/components/NewCommentForm.tsx index f464d4299..0b6948064 100644 --- a/src/components/NewCommentForm.tsx +++ b/src/components/NewCommentForm.tsx @@ -104,15 +104,13 @@ export const NewCommentForm: React.FC = ({ postId, setComments }) => { email: currentEmail, body: currentBody, postId: postId, - }) - .then((data: unknown) => { - const dataAsComment = data as Comment; - - setComments(prevComments => [...prevComments, dataAsComment]); - resetForm('submit'); - setIsAddingComment(false); - }) - .finally(() => {}); + }).then((data: unknown) => { + const dataAsComment = data as Comment; + + setComments(prevComments => [...prevComments, dataAsComment]); + resetForm('submit'); + setIsAddingComment(false); + }); }, [isAddingComment]); return (