From ee9f960cdcb3974f5bb9780665deddb9191a9227 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 4 Nov 2022 21:30:02 +0300 Subject: Fix comments --- vnext/src/ui/Thread.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vnext/src/ui') diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js index bb02e42e..d00c197e 100644 --- a/vnext/src/ui/Thread.js +++ b/vnext/src/ui/Thread.js @@ -55,24 +55,24 @@ export default function Thread(props) { console.log(ex); }); }, [hash, message.mid, mid]); - let onReply = useCallback((json) => { + let onReply = (json) => { const msg = JSON.parse(json.data); if (msg.mid == message.mid) { setReplies(oldReplies => { return [...oldReplies, msg]; }); } - }, [message]); + }; - let postComment = useCallback((template) => { - const { mid, rid, body, attach } = template; - let commentAction = editing.rid ? update(mid, editing.rid, body) : comment(mid, rid, body, attach); + let postComment = (template) => { + const { body, attach } = template; + let commentAction = editing.rid ? update(mid, editing.rid, body) : comment(mid, active, body, attach); commentAction.then(() => { setEditing(emptyMessage); loadReplies(); }) .catch(console.log); - }, [editing.rid, loadReplies]); + }; let startEditing = (reply) => { setActive(reply.replyto); -- cgit v1.2.3