[Glitch] Hide "Follows you" badge when viewing your own list of followers

Port 2fed2edd5e6e5407166ec1233e1c3c0151499579 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
diondiondion 2026-05-07 11:34:20 +02:00 committed by Claire
parent e4c8ac82bd
commit ddd1007ef1
3 changed files with 20 additions and 12 deletions

View File

@ -158,17 +158,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

@ -30,6 +30,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;
} }
@ -42,6 +43,7 @@ export const AccountList: FC<AccountListProps> = ({
list, list,
loadMore, loadMore,
prependAccountId, prependAccountId,
withoutFollowsYouBadge,
scrollKey, scrollKey,
}) => { }) => {
const account = useAccount(accountId); const account = useAccount(accountId);
@ -59,6 +61,7 @@ export const AccountList: FC<AccountListProps> = ({
key={followerId} key={followerId}
accountId={followerId} accountId={followerId}
withBio={false} withBio={false}
badge={withoutFollowsYouBadge ? false : null}
/> />
)) ?? []; )) ?? [];
@ -68,11 +71,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 columnRef = useRef<ColumnRef>(null); const columnRef = useRef<ColumnRef>(null);
const handleHeaderClick = useCallback(() => { const handleHeaderClick = useCallback(() => {

View File

@ -12,6 +12,7 @@ import {
import { useAccount } from '@/flavours/glitch/hooks/useAccount'; import { useAccount } from '@/flavours/glitch/hooks/useAccount';
import { useAccountId } from '@/flavours/glitch/hooks/useAccountId'; import { useAccountId } from '@/flavours/glitch/hooks/useAccountId';
import { useRelationship } from '@/flavours/glitch/hooks/useRelationship'; import { useRelationship } from '@/flavours/glitch/hooks/useRelationship';
import { me } from '@/flavours/glitch/initial_state';
import { selectUserListWithoutMe } from '@/flavours/glitch/selectors/user_lists'; import { selectUserListWithoutMe } from '@/flavours/glitch/selectors/user_lists';
import { useAppDispatch, useAppSelector } from '@/flavours/glitch/store'; import { useAppDispatch, useAppSelector } from '@/flavours/glitch/store';
@ -88,6 +89,7 @@ const Followers: FC = () => {
list={followerList} list={followerList}
loadMore={loadMore} loadMore={loadMore}
prependAccountId={followerId} prependAccountId={followerId}
withoutFollowsYouBadge={accountId === me}
scrollKey='followers' scrollKey='followers'
/> />
); );