From 1ef6e8a29a188bd777585bcb72d47a29f37b1d05 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Sun, 24 Dec 2023 15:44:08 -0500 Subject: [PATCH] Fix photo detail thumbnail count --- src/app/(static)/p/[photoId]/layout.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/(static)/p/[photoId]/layout.tsx b/src/app/(static)/p/[photoId]/layout.tsx index 06133c24..19a26fc9 100644 --- a/src/app/(static)/p/[photoId]/layout.tsx +++ b/src/app/(static)/p/[photoId]/layout.tsx @@ -59,15 +59,20 @@ export default async function PhotoPage({ const photo = photos.find(p => p.id === photoId); if (!photo) { redirect(PATH_ROOT); } - - const index = photos.findIndex(p => p.id === photoId); + + const isPhotoFirst = photos.findIndex(p => p.id === photoId) === 0; return <> {children} ; }