ordering-ui-external 4.0.1 → 4.0.2

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.
@@ -116,13 +116,9 @@ var BusinessControllerUI = function BusinessControllerUI(props) {
116
116
  // }
117
117
 
118
118
  var handleBusinessClick = function handleBusinessClick(e) {
119
- var _favoriteRef$current, _business$menus;
119
+ var _favoriteRef$current;
120
120
  if (favoriteRef !== null && favoriteRef !== void 0 && (_favoriteRef$current = favoriteRef.current) !== null && _favoriteRef$current !== void 0 && _favoriteRef$current.contains(e.target)) return;
121
- var hasMenu = business === null || business === void 0 ? void 0 : (_business$menus = business.menus) === null || _business$menus === void 0 ? void 0 : _business$menus.filter(function (menu) {
122
- var _menu$products;
123
- return (menu === null || menu === void 0 ? void 0 : menu.enabled) && (menu === null || menu === void 0 ? void 0 : (_menu$products = menu.products) === null || _menu$products === void 0 ? void 0 : _menu$products.length) > 0;
124
- }).length;
125
- if (onPreorderBusiness && (!isBusinessOpen || !hasMenu)) onPreorderBusiness(business);else handleClick(business);
121
+ if (onPreorderBusiness && !isBusinessOpen) onPreorderBusiness(business);else handleClick(business);
126
122
  };
127
123
  var handleChangeFavorite = function handleChangeFavorite() {
128
124
  if (auth) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -95,8 +95,7 @@ const BusinessControllerUI = (props) => {
95
95
 
96
96
  const handleBusinessClick = (e) => {
97
97
  if (favoriteRef?.current?.contains(e.target)) return
98
- const hasMenu = business?.menus?.filter(menu => menu?.enabled && menu?.products?.length > 0).length
99
- if (onPreorderBusiness && (!isBusinessOpen || !hasMenu)) onPreorderBusiness(business)
98
+ if (onPreorderBusiness && !isBusinessOpen) onPreorderBusiness(business)
100
99
  else handleClick(business)
101
100
  }
102
101