Merge pull request #1998 from mattermost/plt-1139
PLT-1139 Clear user typing text on channel switch
Этот коммит содержится в:
@@ -25,9 +25,17 @@ export default class MsgTyping extends React.Component {
|
|||||||
SocketStore.addChangeListener(this.onChange);
|
SocketStore.addChangeListener(this.onChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.channelId !== newProps.channelId) {
|
if (this.props.channelId !== nextProps.channelId) {
|
||||||
this.updateTypingText();
|
for (const u in this.typingUsers) {
|
||||||
|
if (!this.typingUsers.hasOwnProperty(u)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(this.typingUsers[u]);
|
||||||
|
}
|
||||||
|
this.typingUsers = {};
|
||||||
|
this.setState({text: ''});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user