[Glitch] Fix not to show follow button in global suggestion

Port ecb285afb8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
Takeshi Umeda 2021-04-16 17:06:42 +09:00 committed by Claire
parent 596855eded
commit bac5e8202a
2 changed files with 7 additions and 5 deletions

View File

@ -87,8 +87,10 @@ class Account extends ImmutablePureComponent {
let buttons;
if (onActionClick && actionIcon) {
buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />;
if (onActionClick) {
if (actionIcon) {
buttons = <IconButton icon={actionIcon} title={actionTitle} onClick={this.handleAction} />;
}
} else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) {
const following = account.getIn(['relationship', 'following']);
const requested = account.getIn(['relationship', 'requested']);

View File

@ -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>