about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/suggestions.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-04-12 12:37:14 +0200
committerGitHub <noreply@github.com>2021-04-12 12:37:14 +0200
commitf7117646afddb2676e9275d8efe90c3a20c59021 (patch)
treeefb9ba8f7b22d27b0a1ea595cfa30030f5d03b09 /app/javascript/mastodon/reducers/suggestions.js
parentad61265268f13d9b2a04e2e176724d8a7376f85a (diff)
Add cold-start follow recommendations (#15945)
Diffstat (limited to 'app/javascript/mastodon/reducers/suggestions.js')
-rw-r--r--app/javascript/mastodon/reducers/suggestions.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/javascript/mastodon/reducers/suggestions.js b/app/javascript/mastodon/reducers/suggestions.js
index 834be728f..1a6e66ee7 100644
--- a/app/javascript/mastodon/reducers/suggestions.js
+++ b/app/javascript/mastodon/reducers/suggestions.js
@@ -19,18 +19,18 @@ export default function suggestionsReducer(state = initialState, action) {
     return state.set('isLoading', true);
   case SUGGESTIONS_FETCH_SUCCESS:
     return state.withMutations(map => {
-      map.set('items', fromJS(action.accounts.map(x => x.id)));
+      map.set('items', fromJS(action.suggestions.map(x => ({ ...x, account: x.account.id }))));
       map.set('isLoading', false);
     });
   case SUGGESTIONS_FETCH_FAIL:
     return state.set('isLoading', false);
   case SUGGESTIONS_DISMISS:
-    return state.update('items', list => list.filterNot(id => id === action.id));
+    return state.update('items', list => list.filterNot(x => x.account === action.id));
   case ACCOUNT_BLOCK_SUCCESS:
   case ACCOUNT_MUTE_SUCCESS:
-    return state.update('items', list => list.filterNot(id => id === action.relationship.id));
+    return state.update('items', list => list.filterNot(x => x.account === action.relationship.id));
   case DOMAIN_BLOCK_SUCCESS:
-    return state.update('items', list => list.filterNot(id => action.accounts.includes(id)));
+    return state.update('items', list => list.filterNot(x => action.accounts.includes(x.account)));
   default:
     return state;
   }