diff --git a/src/app/p/[photoId]/layout.tsx b/src/app/p/[photoId]/layout.tsx index 87370443..680d87d3 100644 --- a/src/app/p/[photoId]/layout.tsx +++ b/src/app/p/[photoId]/layout.tsx @@ -1,5 +1,5 @@ import { - GRID_THUMBNAILS_TO_SHOW_MAX, + // GRID_THUMBNAILS_TO_SHOW_MAX, descriptionForPhoto, titleForPhoto, } from '@/photo'; @@ -13,7 +13,7 @@ import { import PhotoDetailPage from '@/photo/PhotoDetailPage'; import { getPhotoCached, - getPhotosNearIdCached, + // getPhotosNearIdCached, } from '@/cache'; import { getPhotoIds } from '@/services/vercel-postgres'; @@ -60,28 +60,31 @@ export default async function PhotoPage({ params: { photoId }, children, }: PhotoProps & { children: React.ReactNode }) { - const photos = await getPhotosNearIdCached( - photoId, - GRID_THUMBNAILS_TO_SHOW_MAX + 2, - ); + // const photos = await getPhotosNearIdCached( + // photoId, + // GRID_THUMBNAILS_TO_SHOW_MAX + 2, + // ); - const photo = photos.find(p => p.id === photoId); + const photo = await getPhotoCached(photoId); + + // const photo = photos.find(p => p.id === photoId); if (!photo) { redirect(PATH_ROOT); } - const isPhotoFirst = photos.findIndex(p => p.id === photoId) === 0; + // const isPhotoFirst = photos.findIndex(p => p.id === photoId) === 0; return <> {children} ; }