Re-render left pane and timeline items when group members change

This commit is contained in:
Scott Nonnenberg 2021-03-26 11:03:15 -07:00 committed by GitHub
parent b31a44aa76
commit 7a3130a795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 30 deletions

View file

@ -218,7 +218,19 @@ export class ConversationModel extends window.Backbone.Model<
// our first save to the database. Or first fetch from the database.
this.initialPromise = Promise.resolve();
this.throttledBumpTyping = window._.throttle(this.bumpTyping, 300);
this.debouncedUpdateLastMessage = window._.debounce(
this.updateLastMessage.bind(this),
200
);
this.contactCollection = this.getContactCollection();
this.contactCollection.on(
'change:name change:profileName change:profileFamilyName change:e164',
this.debouncedUpdateLastMessage,
this
);
this.messageCollection = new window.Whisper.MessageCollection([], {
conversation: this,
});
@ -226,12 +238,6 @@ export class ConversationModel extends window.Backbone.Model<
this.messageCollection.on('change:errors', this.handleMessageError, this);
this.messageCollection.on('send-error', this.onMessageError, this);
this.throttledBumpTyping = window._.throttle(this.bumpTyping, 300);
this.debouncedUpdateLastMessage = window._.debounce(
this.updateLastMessage.bind(this),
200
);
this.listenTo(
this.messageCollection,
'add remove destroy content-changed',
@ -258,6 +264,8 @@ export class ConversationModel extends window.Backbone.Model<
this.unset('hasFetchedProfile');
this.unset('tokens');
this.on('change:members change:membersV2', this.fetchContacts);
this.typingRefreshTimer = null;
this.typingPauseTimer = null;