diff --git a/thoughts-frontend/app/page.tsx b/thoughts-frontend/app/page.tsx index 3964e24..2a64c1d 100644 --- a/thoughts-frontend/app/page.tsx +++ b/thoughts-frontend/app/page.tsx @@ -72,7 +72,10 @@ async function FeedPage({ ); const friends = (await getFriends(token)).users.map((user) => user.username); - const shouldDisplayTopFriends = me?.topFriends && me.topFriends.length > 8; + const shouldDisplayTopFriends = + token && me?.topFriends && me.topFriends.length > 8; + + console.log("Should display top friends:", shouldDisplayTopFriends); return (
@@ -92,6 +95,13 @@ async function FeedPage({
+ {shouldDisplayTopFriends && ( + + )} + {!shouldDisplayTopFriends && token && friends.length > 0 && ( + + )} +
@@ -129,11 +139,13 @@ async function FeedPage({