From 2747a99aef5a8c1b6f41222451451c1153cd7079 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 11 Feb 2016 10:52:12 -0500 Subject: Fix case where channel has a postlist but no posts --- web/react/utils/async_client.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/react/utils') 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; -- cgit v1.2.3-1-g7c22