fix(feed): show last 5 replies of thread in feed, not first 5 replies

This commit is contained in:
plebeius.eth
2024-04-08 16:08:58 +02:00
parent ebf1e426f5
commit 608aa632d4
+2 -2
View File
@@ -150,7 +150,7 @@ const PostDesktop = ({ post, roles, showAllReplies }: PostProps) => {
)}
{!(pinned && !isInPostPage) &&
replies &&
replies.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (
(showAllReplies ? replies : replies.slice(-5)).map((reply, index) => (
<div key={reply.cid} className={styles.replyContainer}>
<ReplyDesktop index={index} reply={reply} roles={roles} />
</div>
@@ -344,7 +344,7 @@ const PostMobile = ({ post, roles, showAllReplies }: PostProps) => {
</div>
{!(pinned && !isInPostPage) &&
replies &&
replies.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (
(showAllReplies ? replies : replies.slice(-5)).map((reply, index) => (
<div key={reply.cid} className={styles.replyContainer}>
<ReplyMobile index={index} reply={reply} roles={roles} />
</div>