fix(post): reply backlink didn't appear in post info immediately after replying to it

This commit is contained in:
Tom (plebeius.eth)
2024-08-31 14:57:11 +02:00
parent 09a14416c8
commit 0f6b922516
3 changed files with 23 additions and 16 deletions
+5 -3
View File
@@ -172,15 +172,17 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P
};
const ReplyBacklinks = ({ post }: PostProps) => {
const { cid, parentCid, replyCount } = post || {};
const { cid, parentCid } = post || {};
const replies = useReplies(post);
return (
replyCount > 0 &&
cid &&
parentCid &&
replies && (
<div className={styles.mobileReplyBacklinks}>
{replies.map((reply: Comment, index: number) => reply?.parentCid === cid && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />)}
{replies.map(
(reply: Comment, index: number) => reply?.parentCid === cid && reply?.cid && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />,
)}
</div>
)
);