]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #449 - don't do relationships fetch for empty array of IDs
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 15 Jan 2017 13:41:49 +0000 (14:41 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 15 Jan 2017 13:47:39 +0000 (14:47 +0100)
app/assets/javascripts/components/actions/accounts.jsx

index 7ae87f30ed05797118cdf484c6f3c5d83fe04998..e1519d7b563696db6c39cd7cf389ae26cacbbe7b 100644 (file)
@@ -486,6 +486,10 @@ export function expandFollowingFail(id, error) {
 
 export function fetchRelationships(account_ids) {
   return (dispatch, getState) => {
+    if (account_ids.length === 0) {
+      return;
+    }
+
     dispatch(fetchRelationshipsRequest(account_ids));
 
     api(getState).get(`/api/v1/accounts/relationships?${account_ids.map(id => `id[]=${id}`).join('&')}`).then(response => {