Dismiss typing indicator when ConversationView is not loaded
This commit is contained in:
parent
70eed938d9
commit
a291834301
1 changed files with 6 additions and 2 deletions
|
@ -112,7 +112,7 @@
|
||||||
this.updateLastMessage
|
this.updateLastMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
this.on('newmessage', this.updateLastMessage);
|
this.on('newmessage', this.onNewMessage);
|
||||||
this.on('change:profileKey', this.onChangeProfileKey);
|
this.on('change:profileKey', this.onChangeProfileKey);
|
||||||
|
|
||||||
// Listening for out-of-band data updates
|
// Listening for out-of-band data updates
|
||||||
|
@ -269,13 +269,17 @@
|
||||||
removeMessage();
|
removeMessage();
|
||||||
},
|
},
|
||||||
|
|
||||||
addSingleMessage(message) {
|
async onNewMessage(message) {
|
||||||
|
await this.updateLastMessage();
|
||||||
|
|
||||||
// Clear typing indicator for a given contact if we receive a message from them
|
// Clear typing indicator for a given contact if we receive a message from them
|
||||||
const identifier = message.get
|
const identifier = message.get
|
||||||
? `${message.get('source')}.${message.get('sourceDevice')}`
|
? `${message.get('source')}.${message.get('sourceDevice')}`
|
||||||
: `${message.source}.${message.sourceDevice}`;
|
: `${message.source}.${message.sourceDevice}`;
|
||||||
this.clearContactTypingTimer(identifier);
|
this.clearContactTypingTimer(identifier);
|
||||||
|
},
|
||||||
|
|
||||||
|
addSingleMessage(message) {
|
||||||
const model = this.messageCollection.add(message, { merge: true });
|
const model = this.messageCollection.add(message, { merge: true });
|
||||||
model.setToExpire();
|
model.setToExpire();
|
||||||
return model;
|
return model;
|
||||||
|
|
Loading…
Reference in a new issue