diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_focus_view.jsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/webapp/components/post_focus_view.jsx b/webapp/components/post_focus_view.jsx index 7ff20c78d..f3dfb46c6 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() { |