stop typing indicator on message received

This commit is contained in:
or-else
2021-08-22 19:40:08 -07:00
parent bf19cd1351
commit 8294248e2d
5 changed files with 12 additions and 11 deletions
+4 -4
View File
@@ -508,7 +508,8 @@ class MessagesView extends React.Component {
return;
}
this.setState({latestMsgSeq: topic.maxMsgSeq()});
clearTimeout(this.keyPressTimer)
this.setState({latestMsgSeq: topic.maxMsgSeq(), typingIndicator: false});
// If the message is added to the end of the message list,
// scroll to the bottom.
@@ -538,9 +539,8 @@ class MessagesView extends React.Component {
switch (info.what) {
case 'kp': {
clearTimeout(this.keyPressTimer);
var instance = this;
this.keyPressTimer = setTimeout(function() {
instance.setState({typingIndicator: false});
this.keyPressTimer = setTimeout(() => {
this.setState({typingIndicator: false});
}, KEYPRESS_DELAY + 1000);
if (!this.state.typingIndicator) {
this.setState({typingIndicator: true});