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});
+5 -4
View File
@@ -3255,8 +3255,10 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
return;
}
clearTimeout(this.keyPressTimer);
this.setState({
latestMsgSeq: topic.maxMsgSeq()
latestMsgSeq: topic.maxMsgSeq(),
typingIndicator: false
});
if (topic.isNewMessage(msg.seq)) {
@@ -3289,9 +3291,8 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
case 'kp':
{
clearTimeout(this.keyPressTimer);
var instance = this;
this.keyPressTimer = setTimeout(function () {
instance.setState({
this.keyPressTimer = setTimeout(() => {
this.setState({
typingIndicator: false
});
}, _config_js__WEBPACK_IMPORTED_MODULE_14__.KEYPRESS_DELAY + 1000);
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long