From 5080dee12191243e5f30c2af6a18b8991e672948 Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Thu, 16 May 2024 19:10:53 +0200 Subject: [PATCH] Update post.tsx --- src/components/post/post.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx index 4f874a0f..da4d884d 100644 --- a/src/components/post/post.tsx +++ b/src/components/post/post.tsx @@ -31,13 +31,13 @@ interface PostProps { const PostInfoDesktop = ({ isInPostPage, openReplyModal, post, roles }: PostProps) => { const { t } = useTranslation(); - const { author, cid, locked, pinned, postCid, shortCid, state, subplebbitAddress, timestamp, title } = post || {}; + const { author, cid, locked, pinned, parentCid, postCid, shortCid, state, subplebbitAddress, timestamp, title } = post || {}; const { address, displayName, shortAddress } = author || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const stateString = useStateString(post); - const isReply = post?.parentCid; + const isReply = parentCid; const shortDisplayName = displayName?.trim().length > 20 ? displayName?.trim().slice(0, 20).trim() + '...' : displayName?.trim(); const authorRole = roles?.[address]?.role; @@ -130,7 +130,7 @@ const PostInfoDesktop = ({ isInPostPage, openReplyModal, post, roles }: PostProp const PostMediaDesktop = ({ post }: PostProps) => { const { t } = useTranslation(); - const { link, linkHeight, linkWidth } = post || {}; + const { link, linkHeight, linkWidth, parentCid } = post || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const commentMediaInfo = getCommentMediaInfo(post); const { type, url } = commentMediaInfo || {}; @@ -138,7 +138,7 @@ const PostMediaDesktop = ({ post }: PostProps) => { const hasThumbnail = getHasThumbnail(commentMediaInfo, link); const [showThumbnail, setShowThumbnail] = useState(true); - const isReply = post?.parentCid; + const isReply = parentCid; return ( url && ( @@ -390,7 +390,7 @@ const PostMessageMobile = ({ isInPostPage, post }: PostProps) => { return ( content && (
- {isReplyingToReply && ( + {isReply && isReplyingToReply && ( <> {`c/${parentCid && Plebbit.getShortCid(parentCid)}`}