mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(comment-content): prevent doubled >>postnumber quote when cidToNumber resolves late
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user