fix: prevent slider flickering
This commit is contained in:
1 parent
183c7231a1
commit
af942149af
8 files changed
+53
-26
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
|
||||
import { Metadata } from 'next';
|
||||
import { cookies } from 'next/headers';
|
||||
|
||||
import usersShowsQuery from '@/data/queries/usersShows';
|
||||
import { TITLE } from '@/env';
|
||||
import getQueryClient from '@/lib/queryClient';
|
||||
|
||||
import UsersList from '../components/UsersLists';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: `My watch list | ${TITLE}`,
|
||||
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
|
||||
};
|
||||
|
||||
const WatchList = async () => {
|
||||
const session = cookies().get('session')?.value;
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const list = 'watchlist';
|
||||
|
||||
if (session) {
|
||||
await queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType: 'movie', session, list }));
|
||||
}
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<UsersList session={session} list={list} label='watch' />
|
||||
</HydrationBoundary>
|
||||
);
|
||||
};
|
||||
|
||||
export default WatchList;
|
||||
Reference in new issue
Block a user