From e0091371847314651279ea4b179c9e7574156c34 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sun, 7 Apr 2024 18:16:12 +0200 Subject: [PATCH] Update post.tsx --- src/components/post/post.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index d3c5149d..30c2c673 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -292,9 +292,11 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b const { t } = useTranslation(); const { author, cid, content, link, linkHeight, linkWidth, pinned, replyCount, shortCid, subplebbitAddress, timestamp, title } = post || {}; const { address, displayName, shortAddress } = author || {}; + const linkCount = useCountLinksInReplies(post); + const isInPostPage = isPostPageView(useLocation().pathname, useParams()); const displayTitle = title && title.length > 30 ? title?.slice(0, 30) + '(...)' : title; - const displayContent = content && content.length > 1000 ? content?.slice(0, 1000) : content; + const displayContent = content && !isInPostPage && content.length > 1000 ? content?.slice(0, 1000) : content; const commentMediaInfo = getCommentMediaInfoMemoized(post); const hasThumbnail = getHasThumbnail(commentMediaInfo, link); @@ -302,8 +304,6 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b const replies = useReplies(post); - const isInPostPage = isPostPageView(useLocation().pathname, useParams()); - return (
@@ -366,8 +366,9 @@ const PostMobile = ({ post, showAllReplies }: { post: Comment; showAllReplies: b
)}
- {!pinned && - replies?.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => ( + {!(pinned && !isInPostPage) && + replies && + replies.slice(0, showAllReplies ? replies.length : 5).map((reply, index) => (