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) && ( {(isMutual || isFollower) && (
<> <>
&middot; &middot;
{isMutual ? ( <span>
<FormattedMessage {isMutual ? (
id='account.mutual' <FormattedMessage
defaultMessage='You follow each other' id='account.mutual'
/> defaultMessage='You follow each other'
) : ( />
<FormattedMessage ) : (
id='account.follows_you' <FormattedMessage
defaultMessage='Follows you' id='account.follows_you'
/> defaultMessage='Follows you'
)} />
)}
</span>
</> </>
)} )}
</div> </div>

View File

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

View File

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