You've already forked AstralRinth
fix: broken infinite query on files.vue (#5133)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user