From 9edb2079913a536c73451b274da2fb1034c93a4b Mon Sep 17 00:00:00 2001 From: tobias Date: Thu, 11 Jul 2024 21:04:47 +0200 Subject: [PATCH] Clean up preview pages --- src/app/(app)/pages/preview/[[...path]]/page.tsx | 4 ++-- src/app/(app)/posts/preview/[[...path]]/page.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/(app)/pages/preview/[[...path]]/page.tsx b/src/app/(app)/pages/preview/[[...path]]/page.tsx index dc4bea0..93307ee 100644 --- a/src/app/(app)/pages/preview/[[...path]]/page.tsx +++ b/src/app/(app)/pages/preview/[[...path]]/page.tsx @@ -7,7 +7,7 @@ import { notFound } from 'next/navigation' const PreviewCatchAllPage = async ({ params }: { params: { path: string[] } }) => { noStore() - const [user, page] = await Promise.all([ + const [page] = await Promise.all([ getCurrentUser(), getDocument({ collection: COLLECTION_SLUG_PAGE, @@ -16,7 +16,7 @@ const PreviewCatchAllPage = async ({ params }: { params: { path: string[] } }) = cache: false, }), ]) - /* if (!user || !page) notFound() */ + if (!page) notFound() return } diff --git a/src/app/(app)/posts/preview/[[...path]]/page.tsx b/src/app/(app)/posts/preview/[[...path]]/page.tsx index 78579bb..d3ff82f 100644 --- a/src/app/(app)/posts/preview/[[...path]]/page.tsx +++ b/src/app/(app)/posts/preview/[[...path]]/page.tsx @@ -8,7 +8,7 @@ import PreviewPostPage from '@/components/PreviewPostPage' const PreviewCatchAllPage = async ({ params }: { params: { path: string[] } }) => { noStore() - const [user, page] = await Promise.all([ + const [page] = await Promise.all([ getCurrentUser(), getDocument({ collection: COLLECTION_SLUG_POST, @@ -17,7 +17,7 @@ const PreviewCatchAllPage = async ({ params }: { params: { path: string[] } }) = cache: false, }), ]) - /* if (!user || !page) notFound() */ + if (!page) notFound() return }