diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-07-07 08:30:56 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-07-07 08:30:56 -0400 |
commit | 982c9eeceba2a31f709cfb2a1b259b518f0ca0df (patch) | |
tree | 43559bff8baee093ba9e82cf1d63cc12a80681bc /web/react/components | |
parent | 2a0516f1fd66e3e815f4356caac8eb641519474a (diff) | |
parent | 83e4d3fb9cd2692a0363f48e70a50989b3e9a163 (diff) | |
download | chat-982c9eeceba2a31f709cfb2a1b259b518f0ca0df.tar.gz chat-982c9eeceba2a31f709cfb2a1b259b518f0ca0df.tar.bz2 chat-982c9eeceba2a31f709cfb2a1b259b518f0ca0df.zip |
Merge pull request #134 from nickago/MM-1313
Mm 1313 Made the typing notification more responsive/accurate
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/msg_typing.jsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx index 9d3904757..a6953028f 100644 --- a/web/react/components/msg_typing.jsx +++ b/web/react/components/msg_typing.jsx @@ -11,6 +11,11 @@ module.exports = React.createClass({ componentDidMount: function() { SocketStore.addChangeListener(this._onChange); }, + componentWillReceiveProps: function(newProps) { + if(this.props.channelId !== newProps.channelId) { + this.setState({text:""}); + } + }, componentWillUnmount: function() { SocketStore.removeChangeListener(this._onChange); }, @@ -37,6 +42,9 @@ module.exports = React.createClass({ }, 3000); } } + else if (msg.action == "posted" && msg.channel_id === this.props.channelId) { + this.setState({text:""}) + } }, getInitialState: function() { return { text: "" }; |