Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 絵文字リアクション受け入れ設定をしているアカウントのリアクションボタンが正常に表示されない場合がある問題 #830

Merged
merged 1 commit into from
Aug 31, 2024
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: 8 additions & 0 deletions app/javascript/mastodon/actions/statuses.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { browserHistory } from 'mastodon/components/router';
import { me } from 'mastodon/initial_state';

import api from '../api';

import { fetchRelationships } from './accounts';
import { ensureComposeIsVisible, setComposeToStatus } from './compose';
import { importFetchedStatus, importFetchedStatuses, importFetchedAccount } from './importer';
import { deleteFromTimelines } from './timelines';
Expand Down Expand Up @@ -65,6 +67,12 @@ export function fetchStatus(id, forceFetch = false) {

api().get(`/api/v1/statuses/${id}`).then(response => {
dispatch(importFetchedStatus(response.data));

const accountId = response.data.account.id;
if (me && !getState().getIn(['relationships', accountId])) {
dispatch(fetchRelationships([accountId]));
}

dispatch(fetchStatusSuccess(skipLoading));
}).catch(error => {
dispatch(fetchStatusFail(id, error, skipLoading));
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/status_action_bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ class StatusActionBar extends ImmutablePureComponent {

const emojiReactionAvailableServer = !isHideItem('emoji_reaction_unavailable_server') || account.getIn(['server_features', 'emoji_reaction']);
const emojiReactionPolicy = account.getIn(['other_settings', 'emoji_reaction_policy']) || 'allow';
const following = emojiReactionPolicy !== 'following_only' || (relationship && relationship.get('following'));
const followed = emojiReactionPolicy !== 'followers_only' || (relationship && relationship.get('followed_by'));
const following = emojiReactionPolicy !== 'followers_only' || (relationship && relationship.get('following'));
const followed = emojiReactionPolicy !== 'following_only' || (relationship && relationship.get('followed_by'));
const mutual = emojiReactionPolicy !== 'mutuals_only' || (relationship && relationship.get('following') && relationship.get('followed_by'));
const outside = emojiReactionPolicy !== 'outside_only' || (relationship && (relationship.get('following') || relationship.get('followed_by')));
const denyFromAll = emojiReactionPolicy !== 'block' && emojiReactionPolicy !== 'block';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ class ActionBar extends PureComponent {

const emojiReactionAvailableServer = !isHideItem('emoji_reaction_unavailable_server') || account.getIn(['server_features', 'emoji_reaction']);
const emojiReactionPolicy = account.getIn(['other_settings', 'emoji_reaction_policy']) || 'allow';
const following = emojiReactionPolicy !== 'following_only' || (relationship && relationship.get('following'));
const followed = emojiReactionPolicy !== 'followers_only' || (relationship && relationship.get('followed_by'));
const following = emojiReactionPolicy !== 'followers_only' || (relationship && relationship.get('following'));
const followed = emojiReactionPolicy !== 'following_only' || (relationship && relationship.get('followed_by'));
const mutual = emojiReactionPolicy !== 'mutuals_only' || (relationship && relationship.get('following') && relationship.get('followed_by'));
const outside = emojiReactionPolicy !== 'outside_only' || (relationship && (relationship.get('following') || relationship.get('followed_by')));
const denyFromAll = emojiReactionPolicy !== 'block' && emojiReactionPolicy !== 'block';
Expand Down
Loading