From c5b2e8832cfa10fd425f493ad3259f0fa547d6b5 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 11 Feb 2016 12:52:01 -0500 Subject: If we have less than CHUNK_SIZE posts, then get the first page --- web/react/utils/async_client.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'web') 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; } -- cgit v1.2.3-1-g7c22