Merge pull request #1998 from mattermost/plt-1139

PLT-1139 Clear user typing text on channel switch
Этот коммит содержится в:
Harrison Healey
2016-01-27 12:47:08 -05:00
родитель 8b71d1700a e20f78ad0d
Коммит e50e26a2db

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

@@ -25,9 +25,17 @@ export default class MsgTyping extends React.Component {
SocketStore.addChangeListener(this.onChange);
}
componentWillReceiveProps(newProps) {
if (this.props.channelId !== newProps.channelId) {
this.updateTypingText();
componentWillReceiveProps(nextProps) {
if (this.props.channelId !== nextProps.channelId) {
for (const u in this.typingUsers) {
if (!this.typingUsers.hasOwnProperty(u)) {
continue;
}
clearTimeout(this.typingUsers[u]);
}
this.typingUsers = {};
this.setState({text: ''});
}
}