From 0e692c208873f9722cdc704c9e6104b36fe86a9f Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Wed, 4 Jul 2018 23:06:45 +0800 Subject: [PATCH] [MM-11004] Fix continuous channel loading (#1803) * fix continuous channel loading * revert change on limiting number of pages requested --- app/actions/views/channel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index a37e4518e..f1e6603e4 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -511,17 +511,19 @@ export function increasePostVisibility(channelId, focusedPostId) { }]; const posts = result.data; + let hasMorePost = false; if (posts) { + hasMorePost = posts.order.length >= pageSize; + // make sure to increment the posts visibility // only if we got results actions.push(doIncreasePostVisibility(channelId)); - actions.push(setLoadMorePostsVisible(posts.order.length >= pageSize)); + actions.push(setLoadMorePostsVisible(hasMorePost)); } dispatch(batchActions(actions)); - - return Boolean(posts); + return hasMorePost; }; }