Show members: Pull conversation from group table

This commit is contained in:
Scott Nonnenberg 2019-02-11 14:52:58 -08:00
parent 12739ac82d
commit 462fa712bc
4 changed files with 27 additions and 14 deletions

View file

@ -74,6 +74,17 @@
this.trigger('messageError', message, errors);
},
getContactCollection() {
const collection = new Backbone.Collection();
const collator = new Intl.Collator();
collection.comparator = (left, right) => {
const leftLower = left.getTitle().toLowerCase();
const rightLower = right.getTitle().toLowerCase();
return collator.compare(leftLower, rightLower);
};
return collection;
},
initialize() {
this.ourNumber = textsecure.storage.user.getNumber();
this.verifiedEnum = textsecure.storage.protocol.VerifiedStatus;
@ -82,13 +93,7 @@
// our first save to the database. Or first fetch from the database.
this.initialPromise = Promise.resolve();
this.contactCollection = new Backbone.Collection();
const collator = new Intl.Collator();
this.contactCollection.comparator = (left, right) => {
const leftLower = left.getTitle().toLowerCase();
const rightLower = right.getTitle().toLowerCase();
return collator.compare(leftLower, rightLower);
};
this.contactCollection = this.getContactCollection();
this.messageCollection = new Whisper.MessageCollection([], {
conversation: this,
});