ordering-components-external 13.1.9 → 13.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (14) hide show
  1. package/_bundles/{7.ordering-component.9450050bf4eab3324098.js → 7.ordering-component.777ac76c92b69a69c827.js} +1 -1
  2. package/_bundles/{ordering-component.9450050bf4eab3324098.js → ordering-component.777ac76c92b69a69c827.js} +2 -2
  3. package/_modules/components/BusinessAndProductList/index.js +5 -1
  4. package/package.json +1 -1
  5. package/src/components/BusinessAndProductList/index.js +3 -1
  6. /package/_bundles/{0.ordering-component.9450050bf4eab3324098.js → 0.ordering-component.777ac76c92b69a69c827.js} +0 -0
  7. /package/_bundles/{1.ordering-component.9450050bf4eab3324098.js → 1.ordering-component.777ac76c92b69a69c827.js} +0 -0
  8. /package/_bundles/{2.ordering-component.9450050bf4eab3324098.js → 2.ordering-component.777ac76c92b69a69c827.js} +0 -0
  9. /package/_bundles/{4.ordering-component.9450050bf4eab3324098.js → 4.ordering-component.777ac76c92b69a69c827.js} +0 -0
  10. /package/_bundles/{5.ordering-component.9450050bf4eab3324098.js → 5.ordering-component.777ac76c92b69a69c827.js} +0 -0
  11. /package/_bundles/{6.ordering-component.9450050bf4eab3324098.js → 6.ordering-component.777ac76c92b69a69c827.js} +0 -0
  12. /package/_bundles/{7.ordering-component.9450050bf4eab3324098.js.LICENSE.txt → 7.ordering-component.777ac76c92b69a69c827.js.LICENSE.txt} +0 -0
  13. /package/_bundles/{8.ordering-component.9450050bf4eab3324098.js → 8.ordering-component.777ac76c92b69a69c827.js} +0 -0
  14. /package/_bundles/{ordering-component.9450050bf4eab3324098.js.LICENSE.txt → ordering-component.777ac76c92b69a69c827.js.LICENSE.txt} +0 -0
@@ -680,7 +680,11 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
680
680
  totalPages: categorySelected.id === 'featured' ? featuredRes === null || featuredRes === void 0 || (_featuredRes$content12 = featuredRes.content) === null || _featuredRes$content12 === void 0 || (_featuredRes$content12 = _featuredRes$content12.pagination) === null || _featuredRes$content12 === void 0 ? void 0 : _featuredRes$content12.total_pages : pagination === null || pagination === void 0 ? void 0 : pagination.total_pages
681
681
  }),
682
682
  loading: false,
683
- products: categorySelected.id === 'featured' ? productsListFeatured : searchValue ? [].concat(_toConsumableArray(productsListFeatured), _toConsumableArray(productsList)) : [].concat(_toConsumableArray(productsListFeatured), _toConsumableArray(curCategoryState.products.concat(productsList)))
683
+ products: categorySelected.id === 'featured' ? productsListFeatured : searchValue ? [].concat(_toConsumableArray(productsListFeatured), _toConsumableArray(productsList)).filter(function (product, i, _hash) {
684
+ return _hash.findIndex(function (_product) {
685
+ return (_product === null || _product === void 0 ? void 0 : _product.id) === (product === null || product === void 0 ? void 0 : product.id);
686
+ }) === i;
687
+ }) : [].concat(_toConsumableArray(productsListFeatured), _toConsumableArray(curCategoryState.products.concat(productsList)))
684
688
  };
685
689
  categoriesState[categoryKey] = _newcategoryState;
686
690
  setCategoryState(_objectSpread({}, _newcategoryState));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-components-external",
3
- "version": "13.1.9",
3
+ "version": "13.2.0",
4
4
  "description": "Ordering Internal Dashboard",
5
5
  "main": "./_modules/index.js",
6
6
  "scripts": {
@@ -516,7 +516,9 @@ export const BusinessAndProductList = (props) => {
516
516
  loading: false,
517
517
  products: categorySelected.id === 'featured'
518
518
  ? productsListFeatured
519
- : searchValue ? [...productsListFeatured, ...productsList] : [...productsListFeatured, ...curCategoryState.products.concat(productsList)]
519
+ : searchValue
520
+ ? [...productsListFeatured, ...productsList].filter((product, i, _hash) => _hash.findIndex(_product => _product?.id === product?.id) === i)
521
+ : [...productsListFeatured, ...curCategoryState.products.concat(productsList)]
520
522
  }
521
523
 
522
524
  categoriesState[categoryKey] = newcategoryState