stop typing indicator on message received
This commit is contained in:
@@ -508,7 +508,8 @@ class MessagesView extends React.Component {
|
|||||||
return;
|
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,
|
// If the message is added to the end of the message list,
|
||||||
// scroll to the bottom.
|
// scroll to the bottom.
|
||||||
@@ -538,9 +539,8 @@ class MessagesView extends React.Component {
|
|||||||
switch (info.what) {
|
switch (info.what) {
|
||||||
case 'kp': {
|
case 'kp': {
|
||||||
clearTimeout(this.keyPressTimer);
|
clearTimeout(this.keyPressTimer);
|
||||||
var instance = this;
|
this.keyPressTimer = setTimeout(() => {
|
||||||
this.keyPressTimer = setTimeout(function() {
|
this.setState({typingIndicator: false});
|
||||||
instance.setState({typingIndicator: false});
|
|
||||||
}, KEYPRESS_DELAY + 1000);
|
}, KEYPRESS_DELAY + 1000);
|
||||||
if (!this.state.typingIndicator) {
|
if (!this.state.typingIndicator) {
|
||||||
this.setState({typingIndicator: true});
|
this.setState({typingIndicator: true});
|
||||||
|
|||||||
+5
-4
@@ -3255,8 +3255,10 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearTimeout(this.keyPressTimer);
|
||||||
this.setState({
|
this.setState({
|
||||||
latestMsgSeq: topic.maxMsgSeq()
|
latestMsgSeq: topic.maxMsgSeq(),
|
||||||
|
typingIndicator: false
|
||||||
});
|
});
|
||||||
|
|
||||||
if (topic.isNewMessage(msg.seq)) {
|
if (topic.isNewMessage(msg.seq)) {
|
||||||
@@ -3289,9 +3291,8 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
case 'kp':
|
case 'kp':
|
||||||
{
|
{
|
||||||
clearTimeout(this.keyPressTimer);
|
clearTimeout(this.keyPressTimer);
|
||||||
var instance = this;
|
this.keyPressTimer = setTimeout(() => {
|
||||||
this.keyPressTimer = setTimeout(function () {
|
this.setState({
|
||||||
instance.setState({
|
|
||||||
typingIndicator: false
|
typingIndicator: false
|
||||||
});
|
});
|
||||||
}, _config_js__WEBPACK_IMPORTED_MODULE_14__.KEYPRESS_DELAY + 1000);
|
}, _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