Show loading icon until first page of posts is loaded on channel switch (#3918)

Этот коммит содержится в:
Joram Wilander
2016-09-02 11:21:10 -04:00
коммит произвёл Christopher Speller
родитель ae46819b8e
Коммит effd084023
3 изменённых файлов: 31 добавлений и 11 удалений

Просмотреть файл

@@ -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(