diff --git a/app/javascript/mastodon/components/hover_card_account.tsx b/app/javascript/mastodon/components/hover_card_account.tsx index fe37c213fd0f19..5dbf7e2ed2966e 100644 --- a/app/javascript/mastodon/components/hover_card_account.tsx +++ b/app/javascript/mastodon/components/hover_card_account.tsx @@ -19,7 +19,7 @@ import { FollowButton } from 'mastodon/components/follow_button'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import { ShortNumber } from 'mastodon/components/short_number'; import { useFetchFamiliarFollowers } from 'mastodon/features/account_timeline/hooks/familiar_followers'; -import { domain } from 'mastodon/initial_state'; +import { domain, isHideItem } from 'mastodon/initial_state'; import { getAccountHidden } from 'mastodon/selectors/accounts'; import { useAppSelector, useAppDispatch } from 'mastodon/store'; @@ -54,8 +54,10 @@ export const HoverCardAccount = forwardRef< const relationship = useAppSelector((state) => accountId ? state.relationships.get(accountId) : undefined, ); - const isMutual = relationship?.followed_by && relationship.following; - const isFollower = relationship?.followed_by; + const isHideRelationships = isHideItem('relationships'); + const isMutual = + !isHideRelationships && relationship?.followed_by && relationship.following; + const isFollower = !isHideRelationships && relationship?.followed_by; const hasRelationshipLoaded = !!relationship; const shouldDisplayFamiliarFollowers = diff --git a/app/javascript/mastodon/features/account_timeline/components/account_header.tsx b/app/javascript/mastodon/features/account_timeline/components/account_header.tsx index 2b380645feeafb..6886b140182f2b 100644 --- a/app/javascript/mastodon/features/account_timeline/components/account_header.tsx +++ b/app/javascript/mastodon/features/account_timeline/components/account_header.tsx @@ -51,7 +51,12 @@ import { DomainPill } from 'mastodon/features/account/components/domain_pill'; import FollowRequestNoteContainer from 'mastodon/features/account/containers/follow_request_note_container'; import { useLinks } from 'mastodon/hooks/useLinks'; import { useIdentity } from 'mastodon/identity_context'; -import { autoPlayGif, me, domain as localDomain } from 'mastodon/initial_state'; +import { + autoPlayGif, + me, + domain as localDomain, + isHideItem, +} from 'mastodon/initial_state'; import type { Account } from 'mastodon/models/account'; import type { MenuItem } from 'mastodon/models/dropdown_menu'; import { @@ -221,6 +226,8 @@ export const AccountHeader: React.FC<{ const hidden = useAppSelector((state) => getAccountHidden(state, accountId)); const handleLinkClick = useLinks(); + const isHideRelationships = isHideItem('relationships'); + const handleBlock = useCallback(() => { if (!account) { return; @@ -549,7 +556,7 @@ export const AccountHeader: React.FC<{ text: intl.formatMessage(messages.add_or_remove_from_exclude_antenna), action: handleAddToExcludeAntenna, }); - if (relationship?.followed_by) { + if (!isHideRelationships && relationship?.followed_by) { arr.push({ text: intl.formatMessage(messages.add_or_remove_from_circle), action: handleAddToCircle, @@ -557,7 +564,7 @@ export const AccountHeader: React.FC<{ } arr.push(null); - if (relationship?.followed_by) { + if (!isHideRelationships && relationship?.followed_by) { const handleRemoveFromFollowers = () => { dispatch( openModal({ @@ -710,6 +717,7 @@ export const AccountHeader: React.FC<{ handleReblogToggle, handleReport, handleUnblockDomain, + isHideRelationships, ]); if (!account) { @@ -725,6 +733,7 @@ export const AccountHeader: React.FC<{ if (me !== account.id && relationship) { if ( + !isHideRelationships && relationship.followed_by && (relationship.following || relationship.requested) ) { @@ -736,7 +745,7 @@ export const AccountHeader: React.FC<{ /> , ); - } else if (relationship.followed_by) { + } else if (!isHideRelationships && relationship.followed_by) { info.push( , ); - } else if (relationship.requested_by) { + } else if (!relationship.followed_by && relationship.requested_by) { info.push(