From c08d5e62407778116ef3d18feb17f6356c029a30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6?= Date: Sat, 12 Aug 2023 17:08:25 +0200 Subject: [PATCH] fix(files): dir contents variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files/src/views/FilesList.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index ae93642f985..eb38d09e290 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -58,7 +58,7 @@ ref="filesListVirtual" :current-folder="currentFolder" :current-view="currentView" - :nodes="dirContents" /> + :nodes="dirContentsSorted" /> @@ -163,7 +163,7 @@ export default Vue.extend({ /** * The current directory contents. */ - dirContents(): Node[] { + dirContentsSorted(): Node[] { if (!this.currentView) { return [] } @@ -173,8 +173,7 @@ export default Vue.extend({ // Custom column must provide their own sorting methods if (customColumn?.sort && typeof customColumn.sort === 'function') { - const results = [...(this.currentFolder?._children || []).map(this.getNode).filter(file => file)] - .sort(customColumn.sort) + const results = [...this.dirContents].sort(customColumn.sort) return this.isAscSorting ? results : results.reverse() } @@ -193,12 +192,16 @@ export default Vue.extend({ const orders = new Array(identifiers.length).fill(this.isAscSorting ? 'asc' : 'desc') return orderBy( - [...(this.currentFolder?._children || []).map(this.getNode).filter(file => file)], + [...this.dirContents], identifiers, orders, ) }, + dirContents(): Node[] { + return (this.currentFolder?._children || []).map(this.getNode).filter(file => file) + }, + /** * The current directory is empty. */ -- 2.39.5