summaryrefslogtreecommitdiffstats
path: root/web/react/components/msg_typing.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/msg_typing.jsx')
-rw-r--r--web/react/components/msg_typing.jsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx
index 78b67a216..35a832875 100644
--- a/web/react/components/msg_typing.jsx
+++ b/web/react/components/msg_typing.jsx
@@ -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: ''});
}
}