Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Fix auto loading of posts on best posts page
Browse files Browse the repository at this point in the history
  • Loading branch information
artkravchenko committed Dec 16, 2017
1 parent fb66702 commit fa22630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pages/best-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class BestPostsPage extends React.Component {
handleForceLoadPosts = async () => {
const { river, location } = this.props;
const query = { ...location.query, offset: river.size, limit: LOAD_MORE_LIMIT };
const res = await this.triggers.loadBestPosts(query);
return Array.isArray(res) && res.length >= LOAD_MORE_LIMIT;
const { posts } = await this.triggers.loadBestPosts(query);
return Array.isArray(posts) && posts.length >= LOAD_MORE_LIMIT;
}

render() {
Expand Down
3 changes: 2 additions & 1 deletion src/triggers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ export class ActionsTrigger {
}

loadBestPosts = async (query) => {
let result = false;
let result;

this.dispatch(a.ui.setProgress('loadBestPostsInProgress', true));

Expand All @@ -704,6 +704,7 @@ export class ActionsTrigger {
this.dispatch(a.bestPosts.setPosts(result.posts));
}
} catch (e) {
result = e;
this.dispatch(a.messages.addError(e.message));
}

Expand Down

0 comments on commit fa22630

Please sign in to comment.