summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-11 12:52:01 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-11 12:52:01 -0500
commitc5b2e8832cfa10fd425f493ad3259f0fa547d6b5 (patch)
tree21bee2fce7169824c269f9987b30532a5fe6f55a /web
parent2747a99aef5a8c1b6f41222451451c1153cd7079 (diff)
downloadchat-c5b2e8832cfa10fd425f493ad3259f0fa547d6b5.tar.gz
chat-c5b2e8832cfa10fd425f493ad3259f0fa547d6b5.tar.bz2
chat-c5b2e8832cfa10fd425f493ad3259f0fa547d6b5.zip
If we have less than CHUNK_SIZE posts, then get the first page
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/async_client.jsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 977fa8e7e..dc8013a6b 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -521,7 +521,9 @@ export function getPosts(id) {
return;
}
- if ($.isEmptyObject(PostStore.getAllPosts(channelId))) {
+ const postList = PostStore.getAllPosts(channelId);
+
+ if ($.isEmptyObject(postList) || postList.order.length < Constants.POST_CHUNK_SIZE) {
getPostsPage(channelId, Constants.POST_CHUNK_SIZE);
return;
}