fix(post): pending reply to op would show quote link to op

This commit is contained in:
Tom (plebeius.eth)
2024-07-14 13:11:44 +02:00
parent 3950f7b864
commit ec4ba550aa
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -230,8 +230,9 @@ const PostMessage = ({ post }: PostProps) => {
const displayContent = content && !isInPostView && content.length > 1000 ? content?.slice(0, 1000) + '(...)' : content;
const quotelinkReply = useComment({ commentCid: parentCid });
const isReply = parentCid;
const isReplyingToReply = postCid !== parentCid;
const isReplyingToReply = (postCid && postCid !== parentCid) || quotelinkReply?.postCid !== parentCid;
const stateString = useStateString(post);
@@ -239,8 +240,6 @@ const PostMessage = ({ post }: PostProps) => {
<div className={`${styles.stateString} ${styles.ellipsis}`}>{stateString !== 'Failed' ? <LoadingEllipsis string={stateString} /> : stateString}</div>
);
const quotelinkReply = useComment({ commentCid: parentCid });
return (
<blockquote className={styles.postMessage}>
{isReply && !(removed || deleted) && state !== 'failed' && isReplyingToReply && <ReplyQuotePreview isQuotelinkReply={true} quotelinkReply={quotelinkReply} />}
+2 -3
View File
@@ -165,8 +165,9 @@ const PostMessageMobile = ({ post }: PostProps) => {
const displayContent = content && !isInPostView && content.length > 1000 ? content?.slice(0, 1000) : content;
const quotelinkReply = useComment({ commentCid: parentCid });
const isReply = parentCid;
const isReplyingToReply = postCid !== parentCid;
const isReplyingToReply = (postCid && postCid !== parentCid) || quotelinkReply?.postCid !== parentCid;
const stateString = useStateString(post);
@@ -174,8 +175,6 @@ const PostMessageMobile = ({ post }: PostProps) => {
<div className={`${styles.stateString} ${styles.ellipsis}`}>{stateString !== 'Failed' ? <LoadingEllipsis string={stateString} /> : stateString}</div>
);
const quotelinkReply = useComment({ commentCid: parentCid });
return (
content && (
<blockquote className={`${styles.postMessage} ${!isReply && styles.clampLines}`}>