From 3b954279f731a0842a15ad53e4e68096fc2fd444 Mon Sep 17 00:00:00 2001 From: ner Date: Tue, 29 Oct 2024 19:39:41 +0200 Subject: [PATCH] fix: proper prefetch --- app/(site)/page.tsx | 4 ++-- components/Header/components/Navigation/index.tsx | 4 ++-- components/Random/useRandomMovie.ts | 4 +++- data/queries/popular.ts | 1 - data/queries/random.ts | 2 +- data/queries/similar.ts | 1 - data/queries/usersShows.ts | 1 - hooks/useInfiniteList.ts | 8 +++----- public/sw.js | 2 +- 9 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/(site)/page.tsx b/app/(site)/page.tsx index 49505f8..fcec3e7 100644 --- a/app/(site)/page.tsx +++ b/app/(site)/page.tsx @@ -5,12 +5,12 @@ import getQueryClient from '@/lib/queryClient'; import Container from './container'; -const Random = () => { +const Random = async () => { const queryClient = getQueryClient(); const page = generatePage(); - queryClient.prefetchInfiniteQuery(randomQuery({ page })); + await queryClient.prefetchInfiniteQuery(randomQuery({ page, suspense: false })); return ( diff --git a/components/Header/components/Navigation/index.tsx b/components/Header/components/Navigation/index.tsx index 276c600..46bf2c3 100644 --- a/components/Header/components/Navigation/index.tsx +++ b/components/Header/components/Navigation/index.tsx @@ -25,7 +25,7 @@ export const MobileNavigation = () => { {paths.map(({ path, title }) => ( - +