stop typing indicator on message received
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user