@open-tender/store 0.1.326 → 0.1.328

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.
@@ -14,9 +14,18 @@ var useOrderValidate = function () {
14
14
  var orderCheckout = tslib_1.__rest(preparedOrder || {}, []);
15
15
  var prevOrderCheckout = (0, usePrevious_1.default)(orderCheckout);
16
16
  (0, react_1.useEffect)(function () {
17
+ // Don't validate if the order is already submitted/completed
18
+ if (checkout.completedOrder)
19
+ return;
17
20
  if (preparedOrder && !(0, react_fast_compare_1.default)(prevOrderCheckout, orderCheckout)) {
18
21
  dispatch((0, slices_1.validatePosOrder)());
19
22
  }
20
- }, [dispatch, preparedOrder, prevOrderCheckout, orderCheckout]);
23
+ }, [
24
+ dispatch,
25
+ preparedOrder,
26
+ prevOrderCheckout,
27
+ orderCheckout,
28
+ checkout.completedOrder
29
+ ]);
21
30
  };
22
31
  exports.default = useOrderValidate;
@@ -2,7 +2,7 @@ export interface StandbyState {
2
2
  standby: boolean | null;
3
3
  hydrated: boolean;
4
4
  }
5
- export declare const setStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "standby/setStandby">, hydrateStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/hydrateStandby">;
5
+ export declare const setStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/setStandby">, hydrateStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/hydrateStandby">;
6
6
  export declare const selectStandby: (s: {
7
7
  standby: StandbyState;
8
8
  }) => boolean | null;
@@ -12,9 +12,18 @@ var useOrderValidate = function () {
12
12
  var orderCheckout = __rest(preparedOrder || {}, []);
13
13
  var prevOrderCheckout = usePrevious(orderCheckout);
14
14
  useEffect(function () {
15
+ // Don't validate if the order is already submitted/completed
16
+ if (checkout.completedOrder)
17
+ return;
15
18
  if (preparedOrder && !isEqual(prevOrderCheckout, orderCheckout)) {
16
19
  dispatch(validatePosOrder());
17
20
  }
18
- }, [dispatch, preparedOrder, prevOrderCheckout, orderCheckout]);
21
+ }, [
22
+ dispatch,
23
+ preparedOrder,
24
+ prevOrderCheckout,
25
+ orderCheckout,
26
+ checkout.completedOrder
27
+ ]);
19
28
  };
20
29
  export default useOrderValidate;
@@ -2,7 +2,7 @@ export interface StandbyState {
2
2
  standby: boolean | null;
3
3
  hydrated: boolean;
4
4
  }
5
- export declare const setStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "standby/setStandby">, hydrateStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/hydrateStandby">;
5
+ export declare const setStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/setStandby">, hydrateStandby: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean | null, "standby/hydrateStandby">;
6
6
  export declare const selectStandby: (s: {
7
7
  standby: StandbyState;
8
8
  }) => boolean | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.1.326",
3
+ "version": "0.1.328",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",