add mobile feed posts

This commit is contained in:
plebeius.eth
2024-03-28 12:41:40 +01:00
parent b3353a28f5
commit 2add4fe2bd
5 changed files with 162 additions and 7 deletions
+19
View File
@@ -0,0 +1,19 @@
import { Comment } from '@plebbit/plebbit-react-hooks';
export const countLinksInCommentReplies = (comment: Comment) => {
let linkCount = 0;
if (comment.replyCount > 0) {
for (let reply of comment.replies.pages.topAll.comments) {
if (reply.link) {
linkCount++;
}
if (reply.replyCount > 0) {
linkCount += countLinksInCommentReplies(reply);
}
}
}
return linkCount;
};