]> source.dussan.org Git - nextcloud-server.git/commitdiff
Show most recently deleted files first in trash can
authorOrzu Ionut <orzu.ionut@gmail.com>
Tue, 9 Nov 2021 14:07:36 +0000 (16:07 +0200)
committerszaimen (Rebase PR Action) <szaimen@e.mail.de>
Mon, 15 Nov 2021 22:47:17 +0000 (22:47 +0000)
Signed-off-by: Orzu Ionut <orzu.ionut@gmail.com>
apps/files_trashbin/lib/Trash/TrashManager.php
apps/files_trashbin/src/filelist.js

index 8d75ac21658dead9b7a95865d6521b2bf8677cbf..d5b5e3ffad9c61e7fc1e7d1d70ffae4c5eb9ebe2 100644 (file)
@@ -48,7 +48,7 @@ class TrashManager implements ITrashManager {
                        return array_merge($items, $backend->listTrashRoot($user));
                }, []);
                usort($items, function (ITrashItem $a, ITrashItem $b) {
-                       return $a->getDeletedTime() - $b->getDeletedTime();
+                       return $b->getDeletedTime() - $a->getDeletedTime();
                });
                return $items;
        }
index 4e7f08178024ff3e3ad7d57ceb92bd087b509b70..b9644a7e831f78066319bf248781190e9e10a5dc 100644 (file)
@@ -72,7 +72,7 @@
                        this.$el.find('.undelete').click('click', _.bind(this._onClickRestoreSelected, this))
 
                        // Sort by most recently deleted first
-                       this.setSort('mtime', 'asc')
+                       this.setSort('mtime', 'desc')
 
                        /**
                         * Override crumb making to add "Deleted Files" entry