Sort files by modify date

Closes #850
This commit is contained in:
Igor Zhukov 2015-07-20 00:27:41 +03:00
parent 691d358dd4
commit 43e3d13427

View File

@ -2159,6 +2159,12 @@ angular.module('myApp.controllers', ['myApp.i18n'])
delete $scope.draftMessage.replyToMessage;
if (newVal[0].lastModified) {
newVal.sort(function (file1, file2) {
return file1.lastModified - file2.lastModified;
});
}
for (var i = 0; i < newVal.length; i++) {
AppMessagesManager.sendFile($scope.curDialog.peerID, newVal[i], options);
$scope.$broadcast('ui_message_send');