mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Clear user typing text on channel switch
This commit is contained in:
@@ -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: ''});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user