Update helpers.ts

This commit is contained in:
cond0r 2021-03-03 20:06:21 +02:00
parent f84922d937
commit 59dedf58cc

View File

@ -15,9 +15,9 @@ export function getVariant(product: Product, opts: SelectedOptions) {
) { ) {
return option.values.find((v) => v.label.toLowerCase() === value) return option.values.find((v) => v.label.toLowerCase() === value)
} else if (!value) { } else if (!value) {
return !variant.options.filter( return !variant.options.find(
({ displayName }) => displayName.toLowerCase() === key (v) => v.displayName.toLowerCase() === key
).length )
} }
}) })
) )