Introduce intl-friendly sort order for contact lists (#1900)

This commit is contained in:
Scott Nonnenberg 2017-12-14 16:30:11 -08:00 committed by GitHub
parent 5cf320e429
commit f0aaa7a1c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 16 deletions

View file

@ -72,6 +72,12 @@
this.initialPromise = Promise.resolve();
this.contactCollection = new Backbone.Collection();
var collator = new Intl.Collator();
this.contactCollection.comparator = function(left, right) {
left = left.getTitle().toLowerCase();
right = right.getTitle().toLowerCase();
return collator.compare(left, right);
};
this.messageCollection = new Whisper.MessageCollection([], {
conversation: this
});