diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2021-04-16 17:06:42 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 10:06:42 +0200 |
commit | baed52c2a7d8f91bae3c69150005fc528387785c (patch) | |
tree | e9c7584415862fe3bac181ebde2d9af937bb2e65 /app | |
parent | 9bb334184900f1a4bb0a212cf46542faa0c544fd (diff) |
Fix not to show follow button in global suggestion (#16045)
* Fix not to show follow button in global suggestion * Fix style
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/components/account.js | 6 | ||||
-rw-r--r-- | app/javascript/mastodon/features/compose/components/search_results.js | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/app/javascript/mastodon/components/account.js b/app/javascript/mastodon/components/account.js index 0e40ee1d6..a85d683a7 100644 --- a/app/javascript/mastodon/components/account.js +++ b/app/javascript/mastodon/components/account.js @@ -78,8 +78,10 @@ class Account extends ImmutablePureComponent { let buttons; - if (onActionClick && actionIcon) { - buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />; + if (actionIcon) { + if (onActionClick) { + buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />; + } } else if (account.get('id') !== me && account.get('relationship', null) !== null) { const following = account.getIn(['relationship', 'following']); const requested = account.getIn(['relationship', 'requested']); diff --git a/app/javascript/mastodon/features/compose/components/search_results.js b/app/javascript/mastodon/features/compose/components/search_results.js index c4e160b8a..a8b31b677 100644 --- a/app/javascript/mastodon/features/compose/components/search_results.js +++ b/app/javascript/mastodon/features/compose/components/search_results.js @@ -55,9 +55,9 @@ class SearchResults extends ImmutablePureComponent { <AccountContainer key={suggestion.get('account')} id={suggestion.get('account')} - actionIcon={suggestion.get('source') === 'past_interaction' && 'times'} - actionTitle={suggestion.get('source') === 'past_interaction' && intl.formatMessage(messages.dismissSuggestion)} - onActionClick={suggestion.get('source') === 'past_interaction' && dismissSuggestion} + actionIcon={suggestion.get('source') === 'past_interaction' ? 'times' : null} + actionTitle={suggestion.get('source') === 'past_interaction' ? intl.formatMessage(messages.dismissSuggestion) : null} + onActionClick={dismissSuggestion} /> ))} </div> |