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

Commit 43e3d13

Browse files
committed
Sort files by modify date
Closes #850
1 parent 691d358 commit 43e3d13

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/js/controllers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,6 +2159,12 @@ angular.module('myApp.controllers', ['myApp.i18n'])
21592159

21602160
delete $scope.draftMessage.replyToMessage;
21612161

2162+
if (newVal[0].lastModified) {
2163+
newVal.sort(function (file1, file2) {
2164+
return file1.lastModified - file2.lastModified;
2165+
});
2166+
}
2167+
21622168
for (var i = 0; i < newVal.length; i++) {
21632169
AppMessagesManager.sendFile($scope.curDialog.peerID, newVal[i], options);
21642170
$scope.$broadcast('ui_message_send');

0 commit comments

Comments
 (0)