1
0

fix: remove client side sorting of files (#4240)

* fix: remove default sorting on files page

* fix: lint
This commit is contained in:
Cal H.
2025-08-22 18:28:47 +01:00
committed by GitHub
parent 87dbb6dcbc
commit 44cbbd9ed7
2 changed files with 3 additions and 12 deletions

View File

@@ -393,13 +393,13 @@ const fetchDirectoryContents = async (): Promise<DirectoryResponse> => {
if (currentPage.value === 1) {
return {
items: applyDefaultSort(data.items),
items: data.items,
total: data.total,
}
}
return {
items: [...(directoryData.value?.items || []), ...applyDefaultSort(data.items)],
items: [...(directoryData.value?.items || []), ...data.items],
total: data.total,
}
} catch (error) {
@@ -727,15 +727,6 @@ const handleCreateError = (error: any) => {
}
}
const applyDefaultSort = (items: DirectoryItem[]) => {
return items.sort((a: any, b: any) => {
if (a.type === 'directory' && b.type !== 'directory') return -1
if (a.type !== 'directory' && b.type === 'directory') return 1
return a.name.localeCompare(b.name)
})
}
const handleSort = (field: string) => {
if (sortMethod.value === field) {
sortDesc.value = !sortDesc.value