mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Add getPreviousPage
This commit is contained in:
parent
35c7954809
commit
b0e7737e18
1 changed files with 4 additions and 17 deletions
|
|
@ -241,23 +241,10 @@ export function useGetLibraryItems(
|
|||
? lastPage?.pageInfo?.endCursor
|
||||
: undefined
|
||||
},
|
||||
select: (data) => {
|
||||
console.log('data: ', data, 'infiniteQuery')
|
||||
return data
|
||||
// console.log('data: ', data)
|
||||
// // Keep the rest of the data the same and only refetch the first page
|
||||
// console.log(
|
||||
// 'data.pages.length > 1 && infiniteQuery.isRefetching',
|
||||
// data.pages.length,
|
||||
// infiniteQuery.isRefetching
|
||||
// )
|
||||
// // if (data.pages.length > 1 && infiniteQuery.isRefetching) {
|
||||
// // return {
|
||||
// // ...data,
|
||||
// // pages: [data.pages[0], ...data.pages.slice(1)],
|
||||
// // }
|
||||
// // }
|
||||
// return data
|
||||
getPreviousPageParam: (firstPage: LibraryItems, pages) => {
|
||||
return firstPage.pageInfo.hasPreviousPage
|
||||
? firstPage?.pageInfo?.startCursor
|
||||
: undefined
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue