]> cat aescling's git repositories - mastodon.git/commitdiff
Fix follow suggestions ranking
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 15 Oct 2016 14:54:50 +0000 (16:54 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 15 Oct 2016 14:54:50 +0000 (16:54 +0200)
app/assets/javascripts/components/features/compose/components/suggestions_box.jsx
app/models/follow_suggestion.rb

index baff317d7690f6cd8e4bdce47e69f7bb2ccaf337..3991fee4dc178c123638d39af9476e5a72d8393e 100644 (file)
@@ -52,6 +52,10 @@ const SuggestionsBox = React.createClass({
   render () {
     const accounts = this.props.accounts.take(3);
 
+    if (account.size === 0) {
+      return <div />;
+    }
+
     return (
       <div style={outerStyle}>
         <strong style={headerStyle}>Who to follow</strong>
index 4f06db69cfe983fd3d391b141eafdd8816bf18ce..e925461345d4f1d5b33584284ad7f80329600c10 100644 (file)
@@ -7,7 +7,7 @@ START a=node:account_index(Account={id})
 MATCH (a)-[:follows]->(b)-[:follows]->(c)
 WHERE a <> c
 AND NOT (a)-[:follows]->(c)
-RETURN DISTINCT c.account_id
+RETURN DISTINCT c.account_id, c.nodeRank
 ORDER BY c.nodeRank
 LIMIT {limit}
 END