fix(replies): a reply would not appear immediately if published to a reply that was just published

This commit is contained in:
Tom (plebeius.eth)
2024-07-13 09:53:49 +02:00
parent c4721fff09
commit 3950f7b864
+3 -1
View File
@@ -12,7 +12,9 @@ const useReplies = (comment: Comment) => {
// filter against the original comment's CID and all CIDs in flattened replies
const filter = useCallback(
(accountComment: Comment) => {
return accountComment.parentCid === comment?.cid || replyCids.has(accountComment.parentCid);
const parentCid = accountComment.parentCid || 'n/a';
const isCidInDocument = !!document.querySelector(`[data-cid="${parentCid}"]`);
return parentCid === (comment?.cid || 'n/a') || replyCids.has(parentCid) || isCidInDocument;
},
[comment?.cid, replyCids],
);