summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-11 10:52:12 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-11 10:52:12 -0500
commit2747a99aef5a8c1b6f41222451451c1153cd7079 (patch)
treee9e33f7e2547feea2bb22ceeff7613d4757f6634 /web/react/utils
parentcac086ae22c1525f12c1e8d28393b894aa34fd1e (diff)
downloadchat-2747a99aef5a8c1b6f41222451451c1153cd7079.tar.gz
chat-2747a99aef5a8c1b6f41222451451c1153cd7079.tar.bz2
chat-2747a99aef5a8c1b6f41222451451c1153cd7079.zip
Fix case where channel has a postlist but no posts
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/async_client.jsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index c2b5fe9e5..977fa8e7e 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -527,12 +527,17 @@ export function getPosts(id) {
}
const latestPost = PostStore.getLatestPost(channelId);
+ let latestPostTime = 0;
+
+ if (latestPost != null && latestPost.update_at != null) {
+ latestPostTime = latestPost.update_at;
+ }
callTracker['getPosts_' + channelId] = utils.getTimestamp();
client.getPosts(
channelId,
- latestPost.update_at,
+ latestPostTime,
(data, textStatus, xhr) => {
if (xhr.status === 304 || !data) {
return;