summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-04-20 09:44:29 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-04-20 09:44:29 -0400
commit64b8ed5e2552d2e955ec7e33c9e0d7f09b601053 (patch)
tree2e25d7fa76285a3153b5e62ee1125e5ed406a58d /webapp
parent4ab73d30b742dc3d524ef668fb26bbf76e7a2051 (diff)
downloadchat-64b8ed5e2552d2e955ec7e33c9e0d7f09b601053.tar.gz
chat-64b8ed5e2552d2e955ec7e33c9e0d7f09b601053.tar.bz2
chat-64b8ed5e2552d2e955ec7e33c9e0d7f09b601053.zip
Fixing jumping back to original message when recieving message in permalink view (#2751)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_focus_view.jsx11
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() {