diff --git a/webapp/components/post_focus_view.jsx b/webapp/components/post_focus_view.jsx index 7ff20c78d5..f3dfb46c6f 100644 --- a/webapp/components/post_focus_view.jsx +++ b/webapp/components/post_focus_view.jsx @@ -27,6 +27,7 @@ export default class PostFocusView extends React.Component { this.state = { scrollType: PostsView.SCROLL_TYPE_POST, + currentChannel: ChannelStore.getCurrentId().slice(), scrollPostId: focusedPostId, postList: PostStore.getVisiblePosts(focusedPostId), atTop: PostStore.getVisibilityAtTop(focusedPostId), @@ -48,9 +49,13 @@ export default class PostFocusView extends React.Component { } onChannelChange() { - this.setState({ - scrollType: PostsView.SCROLL_TYPE_POST - }); + const currentChannel = ChannelStore.getCurrentId(); + if (this.state.currentChannel !== currentChannel) { + this.setState({ + currentChannel: currentChannel.slice(), + scrollType: PostsView.SCROLL_TYPE_POST + }); + } } onUserChange() {