From 3fadd719b2ce62838917af6301c1de4829186c53 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 6 May 2024 19:17:34 +0300 Subject: [PATCH] load-after-create --- src/components/Article/CommentsTree.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index 60054831..8ed6fae2 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -29,7 +29,7 @@ export const CommentsTree = (props: Props) => { const [newReactions, setNewReactions] = createSignal([]) const [clearEditor, setClearEditor] = createSignal(false) const [clickedReplyId, setClickedReplyId] = createSignal() - const { reactionEntities, createReaction } = useReactions() + const { reactionEntities, createReaction, loadReactionsBy } = useReactions() const comments = createMemo(() => Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT'), @@ -76,6 +76,7 @@ export const CommentsTree = (props: Props) => { shout: props.shoutId, }) setClearEditor(true) + await loadReactionsBy({ by: { shout: props.shoutSlug } }) } catch (error) { console.error('[handleCreate reaction]:', error) }