From fde3e68f701b6f386b1420de35d4fb47a3247c45 Mon Sep 17 00:00:00 2001 From: Xavier Damman Date: Fri, 13 Jun 2025 16:18:46 +0200 Subject: [PATCH 1/2] Filter out unsupported kinds When fetching posts, it queries KINDS.GROUP_POST. But when fetching approved posts, it doesn't check the kind of the post that has been approved. This fixes it. --- src/components/groups/PostList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/groups/PostList.tsx b/src/components/groups/PostList.tsx index 4bd2d1d5..855c320f 100644 --- a/src/components/groups/PostList.tsx +++ b/src/components/groups/PostList.tsx @@ -111,8 +111,8 @@ export function PostList({ communityId, showOnlyApproved = false, pendingOnly = const kindTag = approval.tags.find(tag => tag[0] === "k"); const kind = kindTag ? Number.parseInt(kindTag[1]) : null; - // Skip this approval if it's for a reply (kind 1111) - if (kind === KINDS.GROUP_POST_REPLY) { + // Skip this approval if unsupported type + if (kind !== KINDS.GROUP_POST) { return null; } From 196d91185614c9dfb3183f01152d6d7bccaef596 Mon Sep 17 00:00:00 2001 From: Xavier Damman Date: Fri, 13 Jun 2025 17:44:25 +0200 Subject: [PATCH 2/2] check kind on parsed event --- src/components/groups/PostList.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/groups/PostList.tsx b/src/components/groups/PostList.tsx index 855c320f..b4d7e784 100644 --- a/src/components/groups/PostList.tsx +++ b/src/components/groups/PostList.tsx @@ -111,15 +111,15 @@ export function PostList({ communityId, showOnlyApproved = false, pendingOnly = const kindTag = approval.tags.find(tag => tag[0] === "k"); const kind = kindTag ? Number.parseInt(kindTag[1]) : null; - // Skip this approval if unsupported type - if (kind !== KINDS.GROUP_POST) { + // Skip this approval if it's for a reply (kind 1111) + if (kind === KINDS.GROUP_POST_REPLY) { return null; } const approvedPost = JSON.parse(approval.content) as NostrEvent; - // Skip if the post itself is a reply - if (approvedPost.kind === KINDS.GROUP_POST_REPLY) { + // Skip if the post itself is of an unsupported kind + if (approvedPost.kind !== KINDS.GROUP_POST) { return null; }