Skip to content

Commit caa7f81

Browse files
committed
Bugfix sending of typing events
1 parent e8b944c commit caa7f81

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

‎src/controllers/molecules/MessageComposer.js‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,15 +351,22 @@ module.exports = {
351351
},
352352

353353
stopUserTypingTimer: function() {
354-
clearTimeout(this.userTypingTimer);
354+
if (this.userTypingTimer) {
355+
clearTimeout(this.userTypingTimer);
356+
this.userTypingTimer = null;
357+
}
355358
},
356359

357360
startServerTypingTimer: function() {
358-
var self = this;
359-
this.serverTypingTimer = setTimeout(function() {
360-
self.sendTyping(self.isTyping);
361-
self.startServerTypingTimer();
362-
}, TYPING_SERVER_TIMEOUT / 2);
361+
if (!this.serverTypingTimer) {
362+
var self = this;
363+
this.serverTypingTimer = setTimeout(function() {
364+
if (self.isTyping) {
365+
self.sendTyping(self.isTyping);
366+
self.startServerTypingTimer();
367+
}
368+
}, TYPING_SERVER_TIMEOUT / 2);
369+
}
363370
},
364371

365372
stopServerTypingTimer: function() {

0 commit comments

Comments
 (0)