fix(comment-content): prevent doubled >>postnumber quote when cidToNumber resolves late

This commit is contained in:
plebeius
2026-03-04 14:37:46 +08:00
parent 51cfaac6a8
commit 1aabe7a6b2
@@ -104,11 +104,13 @@ const CommentContent = ({ comment: post }: { comment: Comment }) => {
if (!quotedCids?.length) return [];
return quotedCids.filter((cid: string) => {
const num = cidToNumber[cid];
return num === undefined || !contentNumbers.has(num);
if (num === undefined) return false;
return !contentNumbers.has(num);
});
}, [quotedCids, cidToNumber, contentNumbers]);
const shouldShowReplyingToReply = isReplyingToReply && (parentCid ? !contentNumbers.has(cidToNumber[parentCid] ?? -1) : true);
const parentNumber = parentCid ? cidToNumber[parentCid] : undefined;
const shouldShowReplyingToReply = isReplyingToReply && parentNumber !== undefined && !contentNumbers.has(parentNumber);
const stateString = useStateString(post);
const hasFailedState = state === 'failed';