[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) && (
<>
&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

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

View File

@ -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'
/>
);