Merge pull request #134 from nickago/MM-1313

Mm 1313 Made the typing notification more responsive/accurate
This commit is contained in:
Christopher Speller
2015-07-07 08:30:56 -04:00

View File

@@ -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: "" };