Hide "Follows you" badge when viewing your own list of followers (#38932)

This commit is contained in:
diondiondion 2026-05-07 11:34:20 +02:00 committed by GitHub
parent 92c9fda9e6
commit 2fed2edd5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 12 deletions

View File

@ -154,17 +154,19 @@ export const HoverCardAccount = forwardRef<
{(isMutual || isFollower) && (
<>
&middot;
{isMutual ? (
<FormattedMessage
id='account.mutual'
defaultMessage='You follow each other'
/>
) : (
<FormattedMessage
id='account.follows_you'
defaultMessage='Follows you'
/>
)}
<span>
{isMutual ? (
<FormattedMessage
id='account.mutual'
defaultMessage='You follow each other'
/>
) : (
<FormattedMessage
id='account.follows_you'
defaultMessage='Follows you'
/>
)}
</span>
</>
)}
</div>

View File

@ -28,6 +28,7 @@ interface AccountListProps {
list?: AccountList | null;
loadMore: () => void;
prependAccountId?: string | null;
withoutFollowsYouBadge?: boolean;
scrollKey: string;
}
@ -40,6 +41,7 @@ export const AccountList: FC<AccountListProps> = ({
list,
loadMore,
prependAccountId,
withoutFollowsYouBadge,
scrollKey,
}) => {
const account = useAccount(accountId);
@ -57,6 +59,7 @@ export const AccountList: FC<AccountListProps> = ({
key={followerId}
accountId={followerId}
withBio={false}
badge={withoutFollowsYouBadge ? false : null}
/>
)) ?? [];
@ -66,11 +69,12 @@ export const AccountList: FC<AccountListProps> = ({
key={prependAccountId}
accountId={prependAccountId}
withBio={false}
badge={withoutFollowsYouBadge ? false : null}
/>,
);
}
return children;
}, [prependAccountId, list, forceEmptyState]);
}, [prependAccountId, list, forceEmptyState, withoutFollowsYouBadge]);
const { multiColumn } = useLayout();

View File

@ -9,6 +9,7 @@ import { expandFollowers, fetchFollowers } from '@/mastodon/actions/accounts';
import { useAccount } from '@/mastodon/hooks/useAccount';
import { useAccountId } from '@/mastodon/hooks/useAccountId';
import { useRelationship } from '@/mastodon/hooks/useRelationship';
import { me } from '@/mastodon/initial_state';
import { selectUserListWithoutMe } from '@/mastodon/selectors/user_lists';
import { useAppDispatch, useAppSelector } from '@/mastodon/store';
@ -85,6 +86,7 @@ const Followers: FC = () => {
list={followerList}
loadMore={loadMore}
prependAccountId={followerId}
withoutFollowsYouBadge={accountId === me}
scrollKey='followers'
/>
);