Throttle typing events, fix profile logging, fix group typing

This commit is contained in:
Scott Nonnenberg 2018-12-10 10:21:40 -08:00
parent a8fbd085e2
commit 3851bf351f
4 changed files with 14 additions and 11 deletions

View file

@ -96,6 +96,7 @@
this.messageCollection.on('change:errors', this.handleMessageError, this);
this.messageCollection.on('send-error', this.onMessageError, this);
this.throttledBumpTyping = _.throttle(this.bumpTyping, 300);
const debouncedUpdateLastMessage = _.debounce(
this.updateLastMessage.bind(this),
200
@ -1502,11 +1503,13 @@
// This might throw if we can't pull the avatar down, so we do it last
await c.setProfileAvatar(profile.avatar);
} catch (error) {
window.log.error(
'getProfile error:',
id,
error && error.stack ? error.stack : error
);
if (error.code !== 403 && error.code !== 404) {
window.log.error(
'getProfile error:',
id,
error && error.stack ? error.stack : error
);
}
} finally {
if (c.hasChanged()) {
await window.Signal.Data.updateConversation(id, c.attributes, {

View file

@ -1592,7 +1592,7 @@
maybeBumpTyping() {
const messageText = this.$messageField.val();
if (messageText.length) {
this.model.bumpTyping();
this.model.throttledBumpTyping();
}
},