mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(reply): no need to render deleted replies that have no children
This commit is contained in:
@@ -450,11 +450,14 @@ const PostDesktop = ({ post, roles, showAllReplies, showReplies = true }: PostPr
|
|||||||
!isInPendingPostView &&
|
!isInPendingPostView &&
|
||||||
replies &&
|
replies &&
|
||||||
showReplies &&
|
showReplies &&
|
||||||
(showAllReplies || showOmittedReplies[cid] ? replies : replies.slice(-5)).map((reply, index) => (
|
(showAllReplies || showOmittedReplies[cid] ? replies : replies.slice(-5))
|
||||||
<div key={index} className={styles.replyContainer}>
|
// Don't render deleted replies that have no children (replyCount = 0)
|
||||||
<Reply reply={reply} roles={roles} postReplyCount={replyCount} />
|
.filter((reply) => !(reply.deleted && (reply.replyCount === 0 || !reply.replyCount)))
|
||||||
</div>
|
.map((reply, index) => (
|
||||||
))}
|
<div key={index} className={styles.replyContainer}>
|
||||||
|
<Reply reply={reply} roles={roles} postReplyCount={replyCount} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
{isDescription && subplebbit?.rules && subplebbit?.rules.length > 0 && (
|
{isDescription && subplebbit?.rules && subplebbit?.rules.length > 0 && (
|
||||||
<div className={styles.replyContainer}>
|
<div className={styles.replyContainer}>
|
||||||
<Reply reply={subplebbitRulesReply} />
|
<Reply reply={subplebbitRulesReply} />
|
||||||
|
|||||||
@@ -359,11 +359,14 @@ const PostMobile = ({ post, roles, showAllReplies, showReplies = true }: PostPro
|
|||||||
!isInPendingPostView &&
|
!isInPendingPostView &&
|
||||||
replies &&
|
replies &&
|
||||||
showReplies &&
|
showReplies &&
|
||||||
(showAllReplies ? replies : replies.slice(-5)).map((reply, index) => (
|
(showAllReplies ? replies : replies.slice(-5))
|
||||||
<div key={index} className={styles.replyContainer}>
|
// Don't render deleted replies that have no children (replyCount = 0)
|
||||||
<Reply postReplyCount={replyCount} reply={reply} roles={roles} />
|
.filter((reply) => !(reply.deleted && (reply.replyCount === 0 || !reply.replyCount)))
|
||||||
</div>
|
.map((reply, index) => (
|
||||||
))}
|
<div key={index} className={styles.replyContainer}>
|
||||||
|
<Reply postReplyCount={replyCount} reply={reply} roles={roles} />
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
{showRules && (
|
{showRules && (
|
||||||
<div className={styles.replyContainer}>
|
<div className={styles.replyContainer}>
|
||||||
<Reply reply={subplebbitRulesReply} />
|
<Reply reply={subplebbitRulesReply} />
|
||||||
|
|||||||
Reference in New Issue
Block a user