mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-22 19:29:36 +00:00
Don't make a new collection on every call to thread.messages()
This commit is contained in:
@@ -40,9 +40,11 @@ var Whisper = Whisper || {};
|
||||
},
|
||||
|
||||
messages: function() {
|
||||
var messages = new Whisper.MessageCollection([], {threadId: this.id});
|
||||
messages.fetch();
|
||||
return messages;
|
||||
if (!this.messageCollection) {
|
||||
this.messageCollection = new Whisper.MessageCollection([], {threadId: this.id});
|
||||
}
|
||||
this.messageCollection.fetch();
|
||||
return this.messageCollection;
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user