ordering-components-external 13.1.5 → 13.1.6
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.
- package/_bundles/{7.ordering-component.743b6b43c6758b355482.js → 7.ordering-component.df125e6026f88a037006.js} +1 -1
- package/_bundles/{ordering-component.743b6b43c6758b355482.js → ordering-component.df125e6026f88a037006.js} +2 -2
- package/_modules/components/Cart/index.js +4 -3
- package/_modules/contexts/OrderContext/index.js +7 -1
- package/package.json +1 -1
- package/src/components/Cart/index.js +4 -3
- package/src/contexts/OrderContext/index.js +9 -1
- /package/_bundles/{0.ordering-component.743b6b43c6758b355482.js → 0.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{1.ordering-component.743b6b43c6758b355482.js → 1.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{2.ordering-component.743b6b43c6758b355482.js → 2.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{4.ordering-component.743b6b43c6758b355482.js → 4.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{5.ordering-component.743b6b43c6758b355482.js → 5.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{6.ordering-component.743b6b43c6758b355482.js → 6.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{7.ordering-component.743b6b43c6758b355482.js.LICENSE.txt → 7.ordering-component.df125e6026f88a037006.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-component.743b6b43c6758b355482.js → 8.ordering-component.df125e6026f88a037006.js} +0 -0
- /package/_bundles/{ordering-component.743b6b43c6758b355482.js.LICENSE.txt → ordering-component.df125e6026f88a037006.js.LICENSE.txt} +0 -0
|
@@ -37,7 +37,8 @@ var Cart = exports.Cart = function Cart(props) {
|
|
|
37
37
|
UIComponent = props.UIComponent,
|
|
38
38
|
handleEditProduct = props.handleEditProduct,
|
|
39
39
|
businessConfigs = props.businessConfigs,
|
|
40
|
-
commentDelayTime = props.commentDelayTime
|
|
40
|
+
commentDelayTime = props.commentDelayTime,
|
|
41
|
+
disablePreviousComment = props.disablePreviousComment;
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Order context manager
|
|
@@ -85,7 +86,7 @@ var Cart = exports.Cart = function Cart(props) {
|
|
|
85
86
|
*/
|
|
86
87
|
var _useState = (0, _react.useState)({
|
|
87
88
|
loading: false,
|
|
88
|
-
result: null,
|
|
89
|
+
result: cart !== null && cart !== void 0 ? cart : null,
|
|
89
90
|
error: null
|
|
90
91
|
}),
|
|
91
92
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -166,7 +167,7 @@ var Cart = exports.Cart = function Cart(props) {
|
|
|
166
167
|
*/
|
|
167
168
|
var handleChangeComment = function handleChangeComment(value, userId) {
|
|
168
169
|
try {
|
|
169
|
-
if (previousComment !== value) {
|
|
170
|
+
if (previousComment !== value || disablePreviousComment) {
|
|
170
171
|
clearTimeout(timeout);
|
|
171
172
|
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
172
173
|
var uuid, body, response, _yield$response$json, result, error, carts;
|
|
@@ -2249,6 +2249,11 @@ var OrderProvider = exports.OrderProvider = function OrderProvider(_ref) {
|
|
|
2249
2249
|
return _ref26.apply(this, arguments);
|
|
2250
2250
|
};
|
|
2251
2251
|
}();
|
|
2252
|
+
var handleOrderStateLoading = function handleOrderStateLoading(loading) {
|
|
2253
|
+
setState(_objectSpread(_objectSpread({}, state), {}, {
|
|
2254
|
+
loading: loading
|
|
2255
|
+
}));
|
|
2256
|
+
};
|
|
2252
2257
|
(0, _react.useEffect)(function () {
|
|
2253
2258
|
if (session.loading || languageState.loading) return;
|
|
2254
2259
|
if (session.auth) {
|
|
@@ -2367,7 +2372,8 @@ var OrderProvider = exports.OrderProvider = function OrderProvider(_ref) {
|
|
|
2367
2372
|
getLastOrderHasNoReview: getLastOrderHasNoReview,
|
|
2368
2373
|
changeCityFilter: changeCityFilter,
|
|
2369
2374
|
confirmMultiCarts: confirmMultiCarts,
|
|
2370
|
-
addMultiProduct: addMultiProduct
|
|
2375
|
+
addMultiProduct: addMultiProduct,
|
|
2376
|
+
handleOrderStateLoading: handleOrderStateLoading
|
|
2371
2377
|
};
|
|
2372
2378
|
var copyState = JSON.parse(JSON.stringify(state));
|
|
2373
2379
|
return /*#__PURE__*/_react.default.createElement(OrderContext.Provider, {
|
package/package.json
CHANGED
|
@@ -13,7 +13,8 @@ export const Cart = (props) => {
|
|
|
13
13
|
UIComponent,
|
|
14
14
|
handleEditProduct,
|
|
15
15
|
businessConfigs,
|
|
16
|
-
commentDelayTime
|
|
16
|
+
commentDelayTime,
|
|
17
|
+
disablePreviousComment
|
|
17
18
|
} = props
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -44,7 +45,7 @@ export const Cart = (props) => {
|
|
|
44
45
|
/**
|
|
45
46
|
* Comment state
|
|
46
47
|
*/
|
|
47
|
-
const [commentState, setCommentState] = useState({ loading: false, result: null, error: null })
|
|
48
|
+
const [commentState, setCommentState] = useState({ loading: false, result: cart ?? null, error: null })
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* Total product in cart
|
|
@@ -117,7 +118,7 @@ export const Cart = (props) => {
|
|
|
117
118
|
*/
|
|
118
119
|
const handleChangeComment = (value, userId) => {
|
|
119
120
|
try {
|
|
120
|
-
if (previousComment !== value) {
|
|
121
|
+
if ((previousComment !== value || disablePreviousComment)) {
|
|
121
122
|
clearTimeout(timeout)
|
|
122
123
|
timeout = setTimeout(async function () {
|
|
123
124
|
setCommentState({ ...commentState, loading: true })
|
|
@@ -1248,6 +1248,13 @@ export const OrderProvider = ({ Alert, children, strategy, isAlsea, isDisableToa
|
|
|
1248
1248
|
setState({ ...state, loading: false })
|
|
1249
1249
|
}
|
|
1250
1250
|
|
|
1251
|
+
const handleOrderStateLoading = (loading) => {
|
|
1252
|
+
setState({
|
|
1253
|
+
...state,
|
|
1254
|
+
loading
|
|
1255
|
+
})
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1251
1258
|
useEffect(() => {
|
|
1252
1259
|
if (session.loading || languageState.loading) return
|
|
1253
1260
|
if (session.auth) {
|
|
@@ -1368,7 +1375,8 @@ export const OrderProvider = ({ Alert, children, strategy, isAlsea, isDisableToa
|
|
|
1368
1375
|
getLastOrderHasNoReview,
|
|
1369
1376
|
changeCityFilter,
|
|
1370
1377
|
confirmMultiCarts,
|
|
1371
|
-
addMultiProduct
|
|
1378
|
+
addMultiProduct,
|
|
1379
|
+
handleOrderStateLoading
|
|
1372
1380
|
}
|
|
1373
1381
|
|
|
1374
1382
|
const copyState = JSON.parse(JSON.stringify(state))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|