summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-07 08:30:56 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-07 08:30:56 -0400
commit982c9eeceba2a31f709cfb2a1b259b518f0ca0df (patch)
tree43559bff8baee093ba9e82cf1d63cc12a80681bc /web/react
parent2a0516f1fd66e3e815f4356caac8eb641519474a (diff)
parent83e4d3fb9cd2692a0363f48e70a50989b3e9a163 (diff)
downloadchat-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')
-rw-r--r--web/react/components/msg_typing.jsx8
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: "" };