mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Fixes #61 - Order by timestamps with tests
This commit is contained in:
@@ -61,7 +61,11 @@ var Whisper = Whisper || {};
|
||||
Whisper.Threads = new (Backbone.Collection.extend({
|
||||
localStorage: new Backbone.LocalStorage("Threads"),
|
||||
model: Thread,
|
||||
comparator: 'timestamp',
|
||||
|
||||
comparator: function(m) {
|
||||
return -m.get('timestamp');
|
||||
},
|
||||
|
||||
findOrCreate: function(attributes) {
|
||||
var thread = Whisper.Threads.add(attributes, {merge: true});
|
||||
thread.save();
|
||||
@@ -112,5 +116,6 @@ var Whisper = Whisper || {};
|
||||
}
|
||||
return this.findOrCreate(attributes);
|
||||
}
|
||||
|
||||
}))();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user