From 0f2f857dc3b404b389a7c84b4336fa46b072738b Mon Sep 17 00:00:00 2001
From: "Jan C. Borchardt" <hey@jancborchardt.net>
Date: Wed, 7 Oct 2020 17:18:27 +0200
Subject: [PATCH] Sort deleted files by most recently deleted first

Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
---
 apps/files_trashbin/js/files_trashbin.js     | Bin 12729 -> 12728 bytes
 apps/files_trashbin/js/files_trashbin.js.map | Bin 46050 -> 46097 bytes
 apps/files_trashbin/src/filelist.js          |   4 +++-
 apps/files_trashbin/tests/js/filelistSpec.js |   2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/apps/files_trashbin/js/files_trashbin.js b/apps/files_trashbin/js/files_trashbin.js
index 7a83c5790587eb4ddbe60b8895c8d7460aacc79c..17e5e5f754f6de2af278ae388e43c42d99812fa8 100644
GIT binary patch
delta 14
Vcmdm)yd!yof*@n!W+lPt3IHr|1sDJT

delta 15
Wcmdmyyfb-&f*?~$>Sjg3=?VZcVFiEy

diff --git a/apps/files_trashbin/js/files_trashbin.js.map b/apps/files_trashbin/js/files_trashbin.js.map
index c9160e5a591164b237ff8e65b38647058e026579..0987efc30247b56c8d9ff4684a326b72e511806b 100644
GIT binary patch
delta 116
zcmaF#oN3|<rVX<dIP#q`Ty^{%^CmA=@RD@bcXib9c69VEcGn4XbPNO$!9ZF6&1{Nc
ze2kWxWA&$6s_E-11m_o(C?r)X<mMNbC={h8r{<O9R4SyT=A@RSrYNLk78RFFew885
Ro>-i$t{IcJnLqQg7XaX5C%OOt

delta 76
zcmbREg6Yw7rVX<dII^8GTy^{%vnDTA@RD@ZcXib9c69VEcGn4XbPNO$!9c=yGn--<
dAEW8!SpBJ%lNB<>*-}!Alhrjh+htz%0s!367`Olc

diff --git a/apps/files_trashbin/src/filelist.js b/apps/files_trashbin/src/filelist.js
index 8912789e752..4e7f0817802 100644
--- a/apps/files_trashbin/src/filelist.js
+++ b/apps/files_trashbin/src/filelist.js
@@ -71,7 +71,9 @@
 			var result = OCA.Files.FileList.prototype.initialize.apply(this, arguments)
 			this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this))
 
-			this.setSort('mtime', 'desc')
+			// Sort by most recently deleted first
+			this.setSort('mtime', 'asc')
+
 			/**
 			 * Override crumb making to add "Deleted Files" entry
 			 * and convert files with ".d" extensions to a more
diff --git a/apps/files_trashbin/tests/js/filelistSpec.js b/apps/files_trashbin/tests/js/filelistSpec.js
index a56ee987b78..11ba49c487e 100644
--- a/apps/files_trashbin/tests/js/filelistSpec.js
+++ b/apps/files_trashbin/tests/js/filelistSpec.js
@@ -129,7 +129,7 @@ describe('OCA.Trashbin.FileList tests', function () {
 	describe('Initialization', function () {
 		it('Sorts by mtime by default', function () {
 			expect(fileList._sort).toEqual('mtime');
-			expect(fileList._sortDirection).toEqual('desc');
+			expect(fileList._sortDirection).toEqual('asc');
 		});
 		it('Always returns read and delete permission', function () {
 			expect(fileList.getDirectoryPermissions()).toEqual(OC.PERMISSION_READ | OC.PERMISSION_DELETE);
-- 
GitLab