From ddd1007ef1ee4ef38ec2d10315f3c40cb855d20f Mon Sep 17 00:00:00 2001 From: diondiondion Date: Thu, 7 May 2026 11:34:20 +0200 Subject: [PATCH] [Glitch] Hide "Follows you" badge when viewing your own list of followers Port 2fed2edd5e6e5407166ec1233e1c3c0151499579 to glitch-soc Signed-off-by: Claire --- .../glitch/components/hover_card_account.tsx | 24 ++++++++++--------- .../features/followers/components/list.tsx | 6 ++++- .../glitch/features/followers/index.tsx | 2 ++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/javascript/flavours/glitch/components/hover_card_account.tsx b/app/javascript/flavours/glitch/components/hover_card_account.tsx index c1f51e9b7b..1c4a31537f 100644 --- a/app/javascript/flavours/glitch/components/hover_card_account.tsx +++ b/app/javascript/flavours/glitch/components/hover_card_account.tsx @@ -158,17 +158,19 @@ export const HoverCardAccount = forwardRef< {(isMutual || isFollower) && ( <> · - {isMutual ? ( - - ) : ( - - )} + + {isMutual ? ( + + ) : ( + + )} + )} diff --git a/app/javascript/flavours/glitch/features/followers/components/list.tsx b/app/javascript/flavours/glitch/features/followers/components/list.tsx index d833fc0c54..012c8ed67a 100644 --- a/app/javascript/flavours/glitch/features/followers/components/list.tsx +++ b/app/javascript/flavours/glitch/features/followers/components/list.tsx @@ -30,6 +30,7 @@ interface AccountListProps { list?: AccountList | null; loadMore: () => void; prependAccountId?: string | null; + withoutFollowsYouBadge?: boolean; scrollKey: string; } @@ -42,6 +43,7 @@ export const AccountList: FC = ({ list, loadMore, prependAccountId, + withoutFollowsYouBadge, scrollKey, }) => { const account = useAccount(accountId); @@ -59,6 +61,7 @@ export const AccountList: FC = ({ key={followerId} accountId={followerId} withBio={false} + badge={withoutFollowsYouBadge ? false : null} /> )) ?? []; @@ -68,11 +71,12 @@ export const AccountList: FC = ({ key={prependAccountId} accountId={prependAccountId} withBio={false} + badge={withoutFollowsYouBadge ? false : null} />, ); } return children; - }, [prependAccountId, list, forceEmptyState]); + }, [prependAccountId, list, forceEmptyState, withoutFollowsYouBadge]); const columnRef = useRef(null); const handleHeaderClick = useCallback(() => { diff --git a/app/javascript/flavours/glitch/features/followers/index.tsx b/app/javascript/flavours/glitch/features/followers/index.tsx index 0dc62b8cc9..6ac6adb3ac 100644 --- a/app/javascript/flavours/glitch/features/followers/index.tsx +++ b/app/javascript/flavours/glitch/features/followers/index.tsx @@ -12,6 +12,7 @@ import { import { useAccount } from '@/flavours/glitch/hooks/useAccount'; import { useAccountId } from '@/flavours/glitch/hooks/useAccountId'; import { useRelationship } from '@/flavours/glitch/hooks/useRelationship'; +import { me } from '@/flavours/glitch/initial_state'; import { selectUserListWithoutMe } from '@/flavours/glitch/selectors/user_lists'; import { useAppDispatch, useAppSelector } from '@/flavours/glitch/store'; @@ -88,6 +89,7 @@ const Followers: FC = () => { list={followerList} loadMore={loadMore} prependAccountId={followerId} + withoutFollowsYouBadge={accountId === me} scrollKey='followers' /> );