Fix: Every time you switch the page number of a chunk, the PDF document will be reloaded. #4046 (#4047)

### What problem does this PR solve?

Fix: Every time you switch the page number of a chunk, the PDF document
will be reloaded. #4046

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-12-16 18:51:45 +08:00
committed by GitHub
parent 7fb67c4f67
commit 8ea631a2a0
2 changed files with 2 additions and 12 deletions

View File

@ -45,9 +45,8 @@ export const useFetchNextChunkList = (): ResponseGetType<{
debouncedSearchString,
available,
],
initialData: { data: [], total: 0, documentInfo: {} },
// placeholderData: keepPreviousData,
placeholderData: (previousData) =>
previousData ?? { data: [], total: 0, documentInfo: {} }, // https://github.com/TanStack/query/issues/8183
gcTime: 0,
queryFn: async () => {
const { data } = await kbService.chunk_list({