From fdf66551835ce087b21da57397c92cc64a252078 Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Thu, 23 May 2024 14:40:23 +0200 Subject: [PATCH] Fix shadowed variable --- src/utils/endpoints.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/endpoints.ts b/src/utils/endpoints.ts index 6e0f4db..f13c77f 100644 --- a/src/utils/endpoints.ts +++ b/src/utils/endpoints.ts @@ -298,11 +298,11 @@ export const convertSizesToPayloadImages = ( const min = previous ? previous + (current - previous) / 2 : 0; const max = next ? current + (next - current) / 2 : Infinity; - const images = processedSizes + const imagesAtTargetSize = processedSizes .filter(({ width }) => width > min && width <= max) .sort((a, b) => a.filesize - b.filesize); - const smallestImage = images[0]; + const smallestImage = imagesAtTargetSize[0]; if (!smallestImage) continue; images.push(smallestImage);