diff options
author | JoramWilander <jwawilander@gmail.com> | 2016-02-11 12:52:01 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2016-02-11 12:52:01 -0500 |
commit | c5b2e8832cfa10fd425f493ad3259f0fa547d6b5 (patch) | |
tree | 21bee2fce7169824c269f9987b30532a5fe6f55a /web/react | |
parent | 2747a99aef5a8c1b6f41222451451c1153cd7079 (diff) | |
download | chat-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/react')
-rw-r--r-- | web/react/utils/async_client.jsx | 4 |
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; } |