diff options
author | JoramWilander <jwawilander@gmail.com> | 2016-02-11 10:52:12 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2016-02-11 10:52:12 -0500 |
commit | 2747a99aef5a8c1b6f41222451451c1153cd7079 (patch) | |
tree | e9e33f7e2547feea2bb22ceeff7613d4757f6634 /web/react/utils/async_client.jsx | |
parent | cac086ae22c1525f12c1e8d28393b894aa34fd1e (diff) | |
download | chat-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/async_client.jsx')
-rw-r--r-- | web/react/utils/async_client.jsx | 7 |
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; |