From e61e5b4cec9db2c7f47ce9f536c35ed2c5fd88e4 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 18:08:50 +0200 Subject: [PATCH] fix: profile friends section shows profile owner's following list, not viewer's --- thoughts-frontend/app/users/[username]/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thoughts-frontend/app/users/[username]/page.tsx b/thoughts-frontend/app/users/[username]/page.tsx index 00084a4..dec722c 100644 --- a/thoughts-frontend/app/users/[username]/page.tsx +++ b/thoughts-frontend/app/users/[username]/page.tsx @@ -1,7 +1,6 @@ import { getFollowersList, getFollowingList, - getFriends, getMe, getTopFriends, getUserProfile, @@ -74,9 +73,10 @@ export default async function ProfilePage({ params }: ProfilePageProps) { const authorDetails = new Map(); authorDetails.set(user.username, { avatarUrl: user.avatarUrl }); + // Show who the profile owner follows (uses the already-fetched followingResult). const friends = - typeof token === "string" - ? (await getFriends(token)).users.map((u) => u.username) + followingResult.status === "fulfilled" + ? followingResult.value.items.map((u) => u.username) : []; const topFriendsData = await getTopFriends(username, token).catch(() => ({ topFriends: [] }));