]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix not to show follow button in global suggestion
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Fri, 16 Apr 2021 08:06:42 +0000 (17:06 +0900)
committerClaire <claire.github-309c@sitedethib.com>
Wed, 21 Apr 2021 11:50:51 +0000 (13:50 +0200)
Port baed52c2a7d8f91bae3c69150005fc528387785c to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/components/account.js
app/javascript/flavours/glitch/features/compose/components/search_results.js

index 23399c630efa8c2e854bf8540430a3ff36ee0b3c..20313535bf70d014edc82258386c00a528f89d4b 100644 (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']);
index f5ec6587740b04f481bfc98fd2fc6e73c85e8b0d..c7e225507fbd85f84bd4ef648f40c94780afe6b3 100644 (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>