ref="filesListVirtual"
:current-folder="currentFolder"
:current-view="currentView"
- :nodes="dirContents" />
+ :nodes="dirContentsSorted" />
</NcAppContent>
</template>
/**
* The current directory contents.
*/
- dirContents(): Node[] {
+ dirContentsSorted(): Node[] {
if (!this.currentView) {
return []
}
// 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()
}
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.
*/