mirror of
https://github.com/jakejarvis/hoot.git
synced 2025-10-18 22:34:25 -04:00
Don't prefetch favicons for default suggestions at build-time
This commit is contained in:
27
app/page.tsx
27
app/page.tsx
@@ -1,37 +1,14 @@
|
||||
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
|
||||
import { DomainSearch } from "@/components/domain/domain-search";
|
||||
import { HomeHero } from "@/components/home-hero";
|
||||
import { DEFAULT_SUGGESTIONS } from "@/lib/constants";
|
||||
import { getQueryClient } from "@/trpc/query-client";
|
||||
import { trpc } from "@/trpc/server";
|
||||
|
||||
export const experimental_ppr = true;
|
||||
|
||||
export default async function Home() {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
await Promise.all(
|
||||
DEFAULT_SUGGESTIONS.map((domain) =>
|
||||
queryClient.prefetchQuery(
|
||||
trpc.domain.favicon.queryOptions(
|
||||
{ domain },
|
||||
{
|
||||
staleTime: 60 * 60_000, // 1 hour
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
<div className="container mx-auto my-auto flex items-center justify-center px-4 py-8">
|
||||
<div className="w-full space-y-6">
|
||||
<HomeHero />
|
||||
|
||||
<div className="mx-auto w-full max-w-3xl">
|
||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||
<DomainSearch variant="lg" />
|
||||
</HydrationBoundary>
|
||||
<DomainSearch variant="lg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user