diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-09-02 11:21:10 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-09-02 11:21:10 -0400 |
commit | effd0840231474cc0f967f51fcec3780369ed916 (patch) | |
tree | 032953317a04c340ac995e062776b373980cd2bb /webapp/utils/async_client.jsx | |
parent | ae46819b8e988b99574cd9d98f7e526af0dfe225 (diff) | |
download | chat-effd0840231474cc0f967f51fcec3780369ed916.tar.gz chat-effd0840231474cc0f967f51fcec3780369ed916.tar.bz2 chat-effd0840231474cc0f967f51fcec3780369ed916.zip |
Show loading icon until first page of posts is loaded on channel switch (#3918)
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 74064169f..729160fe4 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -609,14 +609,13 @@ export function getPosts(id) { } const postList = PostStore.getAllPosts(channelId); + const latestPostTime = PostStore.getLatestPostFromPageTime(id); - if ($.isEmptyObject(postList) || postList.order.length < Constants.POST_CHUNK_SIZE) { + if ($.isEmptyObject(postList) || postList.order.length < Constants.POST_CHUNK_SIZE || latestPostTime === 0) { getPostsPage(channelId, Constants.POST_CHUNK_SIZE); return; } - const latestPostTime = PostStore.getLatestPostFromPageTime(id); - callTracker['getPosts_' + channelId] = utils.getTimestamp(); Client.getPosts( |