Skip to content

Commit

Permalink
Check if recommendations has any elements rendering `InterestingPeopl…
Browse files Browse the repository at this point in the history
…e` component
  • Loading branch information
jm90m committed Oct 27, 2017
1 parent ba915b4 commit 9dc5f50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/app/Sidebar/RightSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ export default class RightSidebar extends React.Component {
render={() => (
<div>
{authenticatedUser.last_root_post === '1970-01-01T00:00:00' && <StartNow />}
{authenticated &&
<InterestingPeople
{authenticated && this.props.recommendations.length > 0
? <InterestingPeople
users={this.props.recommendations}
onRefresh={this.handleInterestingPeopleRefresh}
/>}
/>
: <div />}
</div>
)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar/InterestingPeopleWithAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class InterestingPeopleWithAPI extends Component {
const followers = this.props.followingList;
const users = _.sortBy(result, user => user[1])
.reverse()
.slice(0, 5)
.filter(user => !followers.includes(user[0]))
.slice(0, 5)
.map(user => ({ name: user[0] }));
if (users.length > 0) {
this.setState({
Expand Down

0 comments on commit 9dc5f50

Please sign in to comment.