Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/frontend/src/components/ui/servers/FileItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function navigateToFolder() {
const newPath = currentPath.endsWith('/')
? `${currentPath}${props.name}`
: `${currentPath}/${props.name}`
router.push({ query: { path: newPath, page: 1 } })
router.push({ query: { path: newPath } })
}

const isNavigating = ref(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function navigateToFolder() {
const newPath = currentPath.endsWith('/')
? `${currentPath}${props.name}`
: `${currentPath}/${props.name}`
router.push({ query: { path: newPath, page: 1 } })
router.push({ query: { path: newPath } })
}

const isNavigating = ref(false)
Expand Down
11 changes: 9 additions & 2 deletions packages/ui/src/pages/hosting/manage/files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,15 @@ const {
return client.kyros.files_v0.listDirectory(currentPath.value, pageParam, 100)
},
getNextPageParam: (lastPage, allPages) => {
const totalFetched = allPages.reduce((sum, page) => sum + page.items.length, 0)
return totalFetched < lastPage.total ? allPages.length + 1 : undefined
const pageSize = 100
if (lastPage.items.length >= pageSize) {
return allPages.length + 1
}

if (lastPage.current < lastPage.total) {
return lastPage.current + 1
}
return undefined
},
staleTime: 30_000,
initialPageParam: 1,
Expand Down