Skip to content

Commit

Permalink
Improved: code to avoid duplication of feature option (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Oct 25, 2023
1 parent 0fbd6ca commit 4fa17fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/catalog-product-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ export default defineComponent({
const nextFeatureAvailableValues = [] as any
availableVariants.map((variant: any) => {
nextFeatureAvailableValues.push(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`))
if(!nextFeatureAvailableValues.includes(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`))){
nextFeatureAvailableValues.push(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`))
}
})
this.features[nextFeatureType] = nextFeatureType === 'SIZE' ? sortSizes(nextFeatureAvailableValues) : nextFeatureAvailableValues
}
Expand Down

0 comments on commit 4fa17fc

Please sign in to comment.