From 053faae9b67bdcc0f224c0bacb1156c3fb6a623a Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 16 Feb 2026 23:31:52 -0600 Subject: [PATCH] Revert image fetch change --- .../components/ImagePhotoGrid.tsx | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/image-response/components/ImagePhotoGrid.tsx b/src/image-response/components/ImagePhotoGrid.tsx index 385e4012..f1b893a7 100644 --- a/src/image-response/components/ImagePhotoGrid.tsx +++ b/src/image-response/components/ImagePhotoGrid.tsx @@ -7,7 +7,6 @@ import { doAllPhotosHaveOptimizedFiles, getOptimizedPhotoUrl, } from '@/photo/storage'; -import { fetchBase64ImageFromUrl } from '@/utility/image'; export default async function ImagePhotoGrid({ photos, @@ -54,24 +53,7 @@ export default async function ImagePhotoGrid({ const doOptimizedFilesExist = await doAllPhotosHaveOptimizedFiles(photos); - const photoData = await Promise.all(photos.map(async ({ id, url }) => { - const data = await fetchBase64ImageFromUrl( - getOptimizedPhotoUrl({ - imageUrl: url, - size: nextImageWidth, - addBypassSecret: IS_PREVIEW, - compatibilityMode: !doOptimizedFilesExist, - }), - { mode: 'no-cors' }, - ); - return { id, data }; - })); - - const renderPhoto = ( - { id, data }: typeof photoData[number], - width: number, - height: number, - ) => + const renderPhoto = ({ id, url }: Photo, width: number, height: number) =>
- {renderPhoto(photoData[0], cellWidth, cellHeight * 2)} + {renderPhoto(photos[0], cellWidth, cellHeight * 2)}
{/* Small images (R) */}
- {photoData.slice(1).map(photo => + {photos.slice(1).map(photo => renderPhoto(photo, cellWidth, cellHeight), )}
- : photoData.slice(0, count).map(photo => + : photos.slice(0, count).map(photo => renderPhoto(photo, cellWidth, cellHeight), )}