Fix shadowed variable

This commit is contained in:
DrMint 2024-05-23 14:40:23 +02:00
parent cc90b6f593
commit fdf6655183
1 changed files with 2 additions and 2 deletions

View File

@ -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);