Fix option values collection

This commit is contained in:
tniezg 2021-07-28 17:12:52 +02:00
parent c173b47ac9
commit cfa72b080e
2 changed files with 11 additions and 2 deletions

View File

@ -73,8 +73,17 @@ const expandOptions = (
} }
} }
const expandedOptionValues = [...option.values, optionValue] if (existingOptionIndex === -1) {
return [
...accumulatedOptions,
{
...option,
values: [optionValue],
},
]
}
const expandedOptionValues = [...option.values, optionValue]
const expandedOptions = [...accumulatedOptions] const expandedOptions = [...accumulatedOptions]
expandedOptions[existingOptionIndex] = { expandedOptions[existingOptionIndex] = {

View File

@ -12,7 +12,7 @@ const getMediaGallery = (
) => string | null ) => string | null
) => { ) => {
return images.reduce<ProductImage[]>((productImages, _, imageIndex) => { return images.reduce<ProductImage[]>((productImages, _, imageIndex) => {
const imageUrl = getImageUrl(images[imageIndex], 9001, 9001) const imageUrl = getImageUrl(images[imageIndex], 800, 800)
if (imageUrl) { if (imageUrl) {
return [ return [