Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Sort files by modify date
Browse files Browse the repository at this point in the history
Closes #850
  • Loading branch information
zhukov committed Jul 19, 2015
1 parent 691d358 commit 43e3d13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 43e3d13

Please sign in to comment.