Skip to content

Commit c997c2d

Browse files
committed
fix frontend
1 parent cf2eacf commit c997c2d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

frontend/app/search/search.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ const usePagination = () => {
345345
const queryState = useAtomValue(getQueryAtom);
346346
const updateQuery = useSetAtom(updateQueryAtom);
347347
const {data: queryResult, isPending, isError} = useAtomValue(queryResultAtom);
348+
if (isPending || isError) {
349+
return {
350+
pages: [],
351+
nbPages: 0,
352+
refine: () => {},
353+
currentRefinement: queryState.currentPage,
354+
};
355+
}
348356
const pages = [];
349357
for (
350358
let i = Math.max(1, queryState.currentPage - 3);

0 commit comments

Comments
 (0)