Hide "Follows you" badge when viewing your own list of followers (#38932)
This commit is contained in:
parent
92c9fda9e6
commit
2fed2edd5e
@ -154,6 +154,7 @@ export const HoverCardAccount = forwardRef<
|
|||||||
{(isMutual || isFollower) && (
|
{(isMutual || isFollower) && (
|
||||||
<>
|
<>
|
||||||
·
|
·
|
||||||
|
<span>
|
||||||
{isMutual ? (
|
{isMutual ? (
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='account.mutual'
|
id='account.mutual'
|
||||||
@ -165,6 +166,7 @@ export const HoverCardAccount = forwardRef<
|
|||||||
defaultMessage='Follows you'
|
defaultMessage='Follows you'
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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();
|
||||||
|
|
||||||
|
|||||||
@ -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'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user