diff options
| author | MohamedBassem <me@mbassem.com> | 2024-05-19 13:44:27 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-05-19 13:46:33 +0100 |
| commit | e8b47751660e24a6bd24941b6cb6b0ee79ffad3c (patch) | |
| tree | f59c11d3dae9698c4b6e2f824da8eab7e60427ec /apps | |
| parent | d1ad84be48bb3b6914c0d478d13f92861889c466 (diff) | |
| download | karakeep-e8b47751660e24a6bd24941b6cb6b0ee79ffad3c.tar.zst | |
fix: Fix missing bookmarks during pagination if they got created in the same second. Fixes #140
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx | 11 | ||||
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx | 19 |
2 files changed, 18 insertions, 12 deletions
diff --git a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx index e69b5319..54288362 100644 --- a/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx +++ b/apps/mobile/components/bookmarks/UpdatingBookmarkList.tsx @@ -21,10 +21,13 @@ export default function UpdatingBookmarkList({ error, fetchNextPage, isFetchingNextPage, - } = api.bookmarks.getBookmarks.useInfiniteQuery(query, { - initialCursor: null, - getNextPageParam: (lastPage) => lastPage.nextCursor, - }); + } = api.bookmarks.getBookmarks.useInfiniteQuery( + { ...query, useCursorV2: true }, + { + initialCursor: null, + getNextPageParam: (lastPage) => lastPage.nextCursor, + }, + ); if (error) { return <Text>{JSON.stringify(error)}</Text>; diff --git a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx index 53524490..bc6cd6db 100644 --- a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx +++ b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx @@ -22,14 +22,17 @@ export default function UpdatableBookmarksGrid({ itemsPerPage?: number; }) { const { data, fetchNextPage, hasNextPage, isFetchingNextPage } = - api.bookmarks.getBookmarks.useInfiniteQuery(query, { - initialData: () => ({ - pages: [initialBookmarks], - pageParams: [query.cursor], - }), - initialCursor: null, - getNextPageParam: (lastPage) => lastPage.nextCursor, - }); + api.bookmarks.getBookmarks.useInfiniteQuery( + { ...query, useCursorV2: true }, + { + initialData: () => ({ + pages: [initialBookmarks], + pageParams: [query.cursor], + }), + initialCursor: null, + getNextPageParam: (lastPage) => lastPage.nextCursor, + }, + ); const grid = ( <BookmarksGrid |
