Fix message sorting in renderer having issues with varying message key lengths

This commit is contained in:
chylex 2016-10-30 22:41:56 +01:00
parent a94b5a0358
commit 7af9ca8302

View File

@ -31,7 +31,15 @@ var STATE = (function(){
selectChannel: function(channel){
selectedChannel = channel;
MSGS = Object.keys(FILE.getMessages(channel)).sort();
MSGS = Object.keys(FILE.getMessages(channel)).sort((key1, key2) => {
if (key1.length === key2.length){
return key1 > key2 ? 1 : key1 < key2 ? -1 : 0;
}
else{
return key1.length > key2.length ? 1 : -1;
}
});
},
getMessageList: function(startIndex, count){