From ca7b515488fe2f6ab007ae847e1097c29843e908 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 19 Aug 2024 13:21:06 +0800 Subject: [PATCH] Remove some of the cache logging to make debugging easier --- .../networking/library_items/useLibraryItems.tsx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/web/lib/networking/library_items/useLibraryItems.tsx b/packages/web/lib/networking/library_items/useLibraryItems.tsx index 96fa96626..72500f493 100644 --- a/packages/web/lib/networking/library_items/useLibraryItems.tsx +++ b/packages/web/lib/networking/library_items/useLibraryItems.tsx @@ -245,6 +245,11 @@ export function useGetLibraryItems( const cached = queryClient.getQueryData(queryKey) as CachedPagesData if (Number(pageParam) > limit) { // check in the query cache + console.log( + 'cached, previousPageUnchanged', + cached, + previousPageUnchanged + ) if (cached && previousPageUnchanged) { // First check if the previous page had detected a modification // if it had we keep fetching until we find a @@ -271,11 +276,8 @@ export function useGetLibraryItems( includeContent: false, })) as LibraryItemsData - console.log('cached: ', cached) if (cached && cached.pageParams.indexOf(pageParam) > -1) { const idx = cached.pageParams.indexOf(pageParam) - - console.log(' -- checking cache', idx, cached.pages[idx]) // // if there is a cache, check to see if the page is already in it // // and mark whether or not the page has changed try { @@ -284,13 +286,6 @@ export function useGetLibraryItems( const compareFunc = (a: string[], b: string[]) => a.length === b.length && a.every((element, index) => element === b[index]) - console.log( - 'cachedIds == resultIds', - cachedIds == resultIds, - cachedIds, - resultIds, - compareFunc(cachedIds, resultIds) - ) setPreviousPageUnchanged(compareFunc(cachedIds, resultIds)) } catch (err) { console.log('error: ', err)