From 28a9a431db548074415cd0be32f7a0d4741b52fe Mon Sep 17 00:00:00 2001 From: Michael Barrett Date: Tue, 29 Oct 2024 17:07:01 +0000 Subject: [PATCH] Prevent replies from being shown on profile page in admin-x-activitypub (#21454) refs [AP-543](https://linear.app/ghost/issue/AP-543/posts-on-profile-should-not-include-replies) Filtered the posts on the profile page to only show `Create` activities that are not replies. --- apps/admin-x-activitypub/package.json | 2 +- apps/admin-x-activitypub/src/components/Profile.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/admin-x-activitypub/package.json b/apps/admin-x-activitypub/package.json index b9e036e9d3..5a768e7395 100644 --- a/apps/admin-x-activitypub/package.json +++ b/apps/admin-x-activitypub/package.json @@ -1,6 +1,6 @@ { "name": "@tryghost/admin-x-activitypub", - "version": "0.3.3", + "version": "0.3.4", "license": "MIT", "repository": { "type": "git", diff --git a/apps/admin-x-activitypub/src/components/Profile.tsx b/apps/admin-x-activitypub/src/components/Profile.tsx index dc63f944a8..88c559c0ca 100644 --- a/apps/admin-x-activitypub/src/components/Profile.tsx +++ b/apps/admin-x-activitypub/src/components/Profile.tsx @@ -28,7 +28,9 @@ const Profile: React.FC = ({}) => { const {data: following = []} = useFollowingForUser('index'); const {data: followers = []} = useFollowersForUser('index'); const {data: liked = []} = useLikedForUser('index'); - const {data: posts = []} = useOutboxForUser('index'); + const {data: outboxPosts = []} = useOutboxForUser('index'); + + const posts = outboxPosts.filter(post => post.type === 'Create' && !post.object.inReplyTo); // Replace 'index' with the actual handle of the user const {data: userProfile} = useUserDataForUser('index') as {data: ActorProperties | null};