summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_right.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-07-20 11:53:30 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-07-20 11:53:30 -0400
commit1c06c3fa091fee38978c76521120de196b7d74a8 (patch)
tree4f3dab888009c9ef15b63fb5fbf8431c66cf463a /web/react/components/post_right.jsx
parenta1876cf6cc827743d8687a9113b727ef7190f452 (diff)
parent5e27bb3e618d94075e4fb198a937e24338bb0612 (diff)
downloadchat-1c06c3fa091fee38978c76521120de196b7d74a8.tar.gz
chat-1c06c3fa091fee38978c76521120de196b7d74a8.tar.bz2
chat-1c06c3fa091fee38978c76521120de196b7d74a8.zip
Merge pull request #209 from mattermost/mm-831
fixes mm-831 post timestamps now update
Diffstat (limited to 'web/react/components/post_right.jsx')
-rw-r--r--web/react/components/post_right.jsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx
index f1ced7b25..024bff26c 100644
--- a/web/react/components/post_right.jsx
+++ b/web/react/components/post_right.jsx
@@ -280,6 +280,7 @@ module.exports = React.createClass({
componentDidMount: function() {
PostStore.addSelectedPostChangeListener(this._onChange);
PostStore.addChangeListener(this._onChangeAll);
+ UserStore.addStatusesChangeListener(this._onTimeChange);
this.resize();
var self = this;
$(window).resize(function(){
@@ -292,6 +293,7 @@ module.exports = React.createClass({
componentWillUnmount: function() {
PostStore.removeSelectedPostChangeListener(this._onChange);
PostStore.removeChangeListener(this._onChangeAll);
+ UserStore.removeStatusesChangeListener(this._onTimeChange);
},
_onChange: function() {
if (this.isMounted()) {
@@ -302,7 +304,6 @@ module.exports = React.createClass({
}
},
_onChangeAll: function() {
-
if (this.isMounted()) {
// if something was changed in the channel like adding a
@@ -331,6 +332,12 @@ module.exports = React.createClass({
this.setState(getStateFromStores());
}
},
+ _onTimeChange: function() {
+ for (var id in this.state.post_list.posts) {
+ if (!this.refs[id]) continue;
+ this.refs[id].forceUpdate();
+ }
+ },
getInitialState: function() {
return getStateFromStores();
},
@@ -390,7 +397,7 @@ module.exports = React.createClass({
<RootPost post={root_post} commentCount={posts_array.length}/>
<div className="post-right-comments-container">
{ posts_array.map(function(cpost) {
- return <CommentPost key={cpost.id} post={cpost} selected={ (cpost.id == selected_post.id) } />
+ return <CommentPost ref={cpost.id} key={cpost.id} post={cpost} selected={ (cpost.id == selected_post.id) } />
})}
</div>
<div className="post-create__container">