This commit is contained in:
Henrik Larsson
2023-08-21 10:16:11 +02:00
parent 1baa3c1f8d
commit e49b0a06ae
12 changed files with 193 additions and 74 deletions

View File

@@ -8,7 +8,6 @@ import { draftMode } from 'next/headers';
import { notFound } from 'next/navigation';
export const runtime = 'edge';
export const dynamic = 'force-dynamic';
export async function generateMetadata({
params
@@ -31,16 +30,12 @@ interface HomePageParams {
}
export default async function IndexPage({ params }: HomePageParams) {
// const preview = draftMode().isEnabled ? { token: process.env.SANITY_API_READ_TOKEN } : undefined;
const data = await getHomePage(params.locale);
if (!data && !draftMode().isEnabled) {
notFound();
}
console.log('Preview:', draftMode().isEnabled);
return (
<LiveQuery
enabled={draftMode().isEnabled}