From e8b47751660e24a6bd24941b6cb6b0ee79ffad3c Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 19 May 2024 13:44:27 +0100
Subject: fix: Fix missing bookmarks during pagination if they got created in
 the same second. Fixes #140

---
 .../dashboard/bookmarks/UpdatableBookmarksGrid.tsx    | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx')

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
-- 
cgit v1.2.3-70-g09d2

