summaryrefslogtreecommitdiffstats
path: root/web/react/components
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-11-30 11:50:35 -0500
committerJoramWilander <jwawilander@gmail.com>2015-11-30 11:50:35 -0500
commite430b1fd533e42d17d19f99cde1521f51fd221fe (patch)
tree821961bd8d6ec35ca2533435cc0f06d213d58b56 /web/react/components
parentce259ad7f1ce8a52b7fc5af7542a101acf71173e (diff)
downloadchat-e430b1fd533e42d17d19f99cde1521f51fd221fe.tar.gz
chat-e430b1fd533e42d17d19f99cde1521f51fd221fe.tar.bz2
chat-e430b1fd533e42d17d19f99cde1521f51fd221fe.zip
Make sure to have latests posts for the view whhen switching to a channel
Diffstat (limited to 'web/react/components')
-rw-r--r--web/react/components/posts_view_container.jsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/web/react/components/posts_view_container.jsx b/web/react/components/posts_view_container.jsx
index 367d3687e..6d6694fec 100644
--- a/web/react/components/posts_view_container.jsx
+++ b/web/react/components/posts_view_container.jsx
@@ -99,10 +99,12 @@ export default class PostsViewContainer extends React.Component {
if (newIndex === -1) {
newIndex = channels.length;
channels.push(channelId);
- postLists[newIndex] = this.getChannelPosts(channelId);
atTop[newIndex] = PostStore.getVisibilityAtTop(channelId);
}
+ // make sure we have the latest posts from the store
+ postLists[newIndex] = this.getChannelPosts(channelId);
+
this.setState({
currentChannelIndex: newIndex,
currentLastViewed: lastViewed,