Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/javascript/mastodon/components/hover_card_account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -549,15 +556,15 @@ 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,
});
}
arr.push(null);

if (relationship?.followed_by) {
if (!isHideRelationships && relationship?.followed_by) {
const handleRemoveFromFollowers = () => {
dispatch(
openModal({
Expand Down Expand Up @@ -710,6 +717,7 @@ export const AccountHeader: React.FC<{
handleReblogToggle,
handleReport,
handleUnblockDomain,
isHideRelationships,
]);

if (!account) {
Expand All @@ -725,6 +733,7 @@ export const AccountHeader: React.FC<{

if (me !== account.id && relationship) {
if (
!isHideRelationships &&
relationship.followed_by &&
(relationship.following || relationship.requested)
) {
Expand All @@ -736,7 +745,7 @@ export const AccountHeader: React.FC<{
/>
</span>,
);
} else if (relationship.followed_by) {
} else if (!isHideRelationships && relationship.followed_by) {
info.push(
<span key='followed_by' className='relationship-tag'>
<FormattedMessage
Expand All @@ -745,7 +754,7 @@ export const AccountHeader: React.FC<{
/>
</span>,
);
} else if (relationship.requested_by) {
} else if (!relationship.followed_by && relationship.requested_by) {
info.push(
<span key='requested_by' className='relationship-tag'>
<FormattedMessage
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"account.followers": "フォロワー",
"account.followers.empty": "まだ誰もフォローしていません。",
"account.followers_counter": "{count, plural, other {{counter} フォロワー}}",
"account.followers.hidden_from_me": "この情報はあなた自身の設定によって隠されています。",
"account.followers_you_know_counter": "あなたと知り合いの{counter}人",
"account.following": "フォロー中",
"account.following_counter": "{count, plural, other {{counter} フォロー}}",
Expand Down