From a964eaaeb6c22ea7d5897bfef820e3a9de0551e5 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 2 Mar 2026 00:09:57 -0600 Subject: [PATCH] Hide wall compose box when profile owner doesn't follow you Wall posts are filtered by the profile owner's follow list, so posts from non-followed users wouldn't show up anyway. This hides the compose box, FAB button, and shows a contextual message instead. --- src/pages/ProfilePage.tsx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx index 4092e414..a5344997 100644 --- a/src/pages/ProfilePage.tsx +++ b/src/pages/ProfilePage.tsx @@ -762,6 +762,15 @@ export function ProfilePage() { }, [supplementary?.following]); const isOwnProfile = user?.pubkey === pubkey; + + // Does the profile owner follow the current user? + // Wall posts are only visible to people the profile owner follows, + // so we hide the compose box if the profile owner doesn't follow us. + const profileFollowsMe = useMemo(() => { + if (!user?.pubkey || !wallFollowList) return false; + if (isOwnProfile) return true; + return wallFollowList.includes(user.pubkey); + }, [user?.pubkey, wallFollowList, isOwnProfile]); const { togglePin } = usePinnedNotes(isOwnProfile ? pubkey : undefined); // Profile theme: always query (so we can show the indicator), but only apply when enabled @@ -1147,7 +1156,7 @@ export function ProfilePage() { useLayoutOptions(pubkey ? { rightSidebar: , showFAB: true, - onFabClick: activeTab === 'wall' ? openWallCompose : undefined, + onFabClick: activeTab === 'wall' && profileFollowsMe ? openWallCompose : undefined, } : {}); if (!pubkey) { @@ -1534,8 +1543,8 @@ export function ProfilePage() { {/* Wall tab content */} {activeTab === 'wall' && (
- {/* Inline compose box for wall comments */} - {wallReplyTarget && ( + {/* Inline compose box for wall comments (only shown if the profile owner follows you) */} + {wallReplyTarget && profileFollowsMe && (

No wall posts yet

-

Be the first to write on {displayName}'s wall!

+ {profileFollowsMe ? ( +

Be the first to write on {displayName}'s wall!

+ ) : user ? ( +

{displayName} must follow you before you can post on their wall.

+ ) : ( +

Log in to write on {displayName}'s wall.

+ )}
)}