diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-09 14:11:38 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-09 14:12:37 -0700 |
commit | 702112dfb315462919d276a72be2936ad45d7ceb (patch) | |
tree | 3bd70c9f82134fc9b1474b24f16ddd1be64c73c6 /web/react/components/post_list.jsx | |
parent | 04b80b6a25cddce0a44da1409ddc430bc8e797f5 (diff) | |
download | chat-702112dfb315462919d276a72be2936ad45d7ceb.tar.gz chat-702112dfb315462919d276a72be2936ad45d7ceb.tar.bz2 chat-702112dfb315462919d276a72be2936ad45d7ceb.zip |
Placed event listeners on higher level components to avoid app dispatcher vomit
Diffstat (limited to 'web/react/components/post_list.jsx')
-rw-r--r-- | web/react/components/post_list.jsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index d6dc9ce30..2cccdff22 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -78,6 +78,7 @@ module.exports = React.createClass({ PostStore.addChangeListener(this._onChange); ChannelStore.addChangeListener(this._onChange); + UserStore.addStatusesChangeListener(this._onChange); SocketStore.addChangeListener(this._onSocketChange); $(".post-list-holder-by-time").perfectScrollbar(); @@ -157,6 +158,7 @@ module.exports = React.createClass({ componentWillUnmount: function() { PostStore.removeChangeListener(this._onChange); ChannelStore.removeChangeListener(this._onChange); + UserStore.removeStatusesChangeListener(this._onChange); SocketStore.removeChangeListener(this._onSocketChange); $('body').off('click.userpopover'); }, @@ -193,6 +195,8 @@ module.exports = React.createClass({ this.scrolledToNew = false; } this.setState(newState); + } else { + this.forceUpdate() } }, _onSocketChange: function(msg) { |