fix(reply): don't show backlink for deleted or removed reply

This commit is contained in:
Tom (plebeius.eth)
2024-12-01 15:08:40 +01:00
parent f7da51259e
commit d6d2831b46
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -209,7 +209,10 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }:
parentCid &&
replies &&
replies.map(
(reply: Comment, index: number) => reply?.parentCid === cid && reply?.cid && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />,
(reply: Comment, index: number) =>
reply?.parentCid === cid &&
reply?.cid &&
!(reply?.deleted || reply?.removed) && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />,
)}
</span>
</div>
+4 -1
View File
@@ -233,7 +233,10 @@ const ReplyBacklinks = ({ post }: PostProps) => {
replies.length > 0 && (
<div className={styles.mobileReplyBacklinks}>
{replies.map(
(reply: Comment, index: number) => reply?.parentCid === cid && reply?.cid && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />,
(reply: Comment, index: number) =>
reply?.parentCid === cid &&
reply?.cid &&
!(reply?.deleted || reply?.removed) && <ReplyQuotePreview key={index} isBacklinkReply={true} backlinkReply={reply} />,
)}
</div>
)