Merge pull request #134 from nickago/MM-1313

Mm 1313 Made the typing notification more responsive/accurate
Этот коммит содержится в:
Christopher Speller
2015-07-07 08:30:56 -04:00
родитель 2a0516f1fd 83e4d3fb9c
Коммит 982c9eeceb

Просмотреть файл

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