Fix shadowed variable
This commit is contained in:
parent
cc90b6f593
commit
fdf6655183
|
@ -298,11 +298,11 @@ export const convertSizesToPayloadImages = (
|
||||||
const min = previous ? previous + (current - previous) / 2 : 0;
|
const min = previous ? previous + (current - previous) / 2 : 0;
|
||||||
const max = next ? current + (next - current) / 2 : Infinity;
|
const max = next ? current + (next - current) / 2 : Infinity;
|
||||||
|
|
||||||
const images = processedSizes
|
const imagesAtTargetSize = processedSizes
|
||||||
.filter(({ width }) => width > min && width <= max)
|
.filter(({ width }) => width > min && width <= max)
|
||||||
.sort((a, b) => a.filesize - b.filesize);
|
.sort((a, b) => a.filesize - b.filesize);
|
||||||
|
|
||||||
const smallestImage = images[0];
|
const smallestImage = imagesAtTargetSize[0];
|
||||||
if (!smallestImage) continue;
|
if (!smallestImage) continue;
|
||||||
|
|
||||||
images.push(smallestImage);
|
images.push(smallestImage);
|
||||||
|
|
Loading…
Reference in New Issue