summaryrefslogtreecommitdiffstats
path: root/web/react/components/rhs_thread.jsx
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-10-16 18:06:40 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-10-16 18:06:40 +0500
commit0fbe63eb37b0764a106b0fdd47bc149f122b520d (patch)
tree77cadc54d3a8d0e7812e69c50628cc7f3c5d71b7 /web/react/components/rhs_thread.jsx
parentb00ffa83e7371fa7dd4570130ee8b506943aee01 (diff)
parent89716cb046ee3c8f13b361053d91149f5ce29cbf (diff)
downloadchat-0fbe63eb37b0764a106b0fdd47bc149f122b520d.tar.gz
chat-0fbe63eb37b0764a106b0fdd47bc149f122b520d.tar.bz2
chat-0fbe63eb37b0764a106b0fdd47bc149f122b520d.zip
Merge branch 'master' of https://github.com/mattermost/platform into ui-improvements
Diffstat (limited to 'web/react/components/rhs_thread.jsx')
-rw-r--r--web/react/components/rhs_thread.jsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx
index 131253aa5..467d74681 100644
--- a/web/react/components/rhs_thread.jsx
+++ b/web/react/components/rhs_thread.jsx
@@ -3,6 +3,7 @@
var PostStore = require('../stores/post_store.jsx');
var UserStore = require('../stores/user_store.jsx');
+var PreferenceStore = require('../stores/preference_store.jsx');
var utils = require('../utils/utils.jsx');
var SearchBox = require('./search_bar.jsx');
var CreateComment = require('./create_comment.jsx');
@@ -18,6 +19,7 @@ export default class RhsThread extends React.Component {
this.onChange = this.onChange.bind(this);
this.onChangeAll = this.onChangeAll.bind(this);
+ this.forceUpdateInfo = this.forceUpdateInfo.bind(this);
this.state = this.getStateFromStores();
}
@@ -43,6 +45,7 @@ export default class RhsThread extends React.Component {
componentDidMount() {
PostStore.addSelectedPostChangeListener(this.onChange);
PostStore.addChangeListener(this.onChangeAll);
+ PreferenceStore.addChangeListener(this.forceUpdateInfo);
this.resize();
$(window).resize(function resize() {
this.resize();
@@ -57,6 +60,16 @@ export default class RhsThread extends React.Component {
componentWillUnmount() {
PostStore.removeSelectedPostChangeListener(this.onChange);
PostStore.removeChangeListener(this.onChangeAll);
+ PreferenceStore.removeChangeListener(this.forceUpdateInfo);
+ }
+ forceUpdateInfo() {
+ if (this.state.postList) {
+ for (var postId in this.state.postList.posts) {
+ if (this.refs[postId]) {
+ this.refs[postId].forceUpdate();
+ }
+ }
+ }
}
onChange() {
var newState = this.getStateFromStores();
@@ -174,6 +187,7 @@ export default class RhsThread extends React.Component {
/>
<div className='post-right__scroll'>
<RootPost
+ ref={rootPost.id}
post={rootPost}
commentCount={postsArray.length}
/>