Remove redundant listenTo calls in ConversationModel#fetchContacts
This commit is contained in:
parent
7a3130a795
commit
902e48e308
1 changed files with 6 additions and 9 deletions
|
@ -230,6 +230,12 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
this.debouncedUpdateLastMessage,
|
this.debouncedUpdateLastMessage,
|
||||||
this
|
this
|
||||||
);
|
);
|
||||||
|
if (!this.isPrivate()) {
|
||||||
|
this.contactCollection.on(
|
||||||
|
'change:verified',
|
||||||
|
this.onMemberVerifiedChange.bind(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
this.messageCollection = new window.Whisper.MessageCollection([], {
|
this.messageCollection = new window.Whisper.MessageCollection([], {
|
||||||
conversation: this,
|
conversation: this,
|
||||||
|
@ -1986,8 +1992,6 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
this.onMemberVerifiedChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setVerifiedDefault(options?: VerificationOptions): Promise<unknown> {
|
setVerifiedDefault(options?: VerificationOptions): Promise<unknown> {
|
||||||
|
@ -4750,14 +4754,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchContacts(): void {
|
fetchContacts(): void {
|
||||||
if (this.isPrivate()) {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
this.contactCollection!.reset([this]);
|
|
||||||
}
|
|
||||||
const members = this.getMembers();
|
const members = this.getMembers();
|
||||||
window._.forEach(members, member => {
|
|
||||||
this.listenTo(member, 'change:verified', this.onMemberVerifiedChange);
|
|
||||||
});
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
this.contactCollection!.reset(members);
|
this.contactCollection!.reset(members);
|
||||||
|
|
Loading…
Reference in a new issue