From d38e696239ad2c6a9b10cccacac601c991a3c577 Mon Sep 17 00:00:00 2001 From: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:21:07 +0200 Subject: [PATCH] Fix homepage loading UX (#4935) --- packages/atlas/src/hooks/useInfiniteVideoGrid.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/atlas/src/hooks/useInfiniteVideoGrid.ts b/packages/atlas/src/hooks/useInfiniteVideoGrid.ts index 59abf15c5a..78c22a178a 100644 --- a/packages/atlas/src/hooks/useInfiniteVideoGrid.ts +++ b/packages/atlas/src/hooks/useInfiniteVideoGrid.ts @@ -49,10 +49,7 @@ export const useInfiniteVideoGrid = ({ const firstLoadPlaceholders = firstLoad ? createPlaceholderData(columns * initialRowsToLoad) : [] const displayedItems = dataConnection?.edges.map((edge) => edge.node) || [] - const itemsLeft = (dataConnection?.totalCount || 0) - (dataConnection?.edges?.length || 0) - const itemsToLoad = Math.min(itemsLeft, columns * 4) - - const nextLoadPlaceholders = !dataConnection?.pageInfo.hasNextPage || false ? [] : createPlaceholderData(itemsToLoad) + const nextLoadPlaceholders = dataConnection?.pageInfo.hasNextPage ? createPlaceholderData(columns * 4) : [] return { tiles: [...firstLoadPlaceholders, ...displayedItems, ...(loading ? nextLoadPlaceholders : [])],