@lookiero/checkout 12.1.0 → 12.1.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.
@@ -34,7 +34,7 @@ const CheckoutMiddleware = ({ customerId, onNotAccessible, loader = React.create
34
34
  const feedbackRouteMatchRef = useRef(feedbackRouteMatch);
35
35
  feedbackRouteMatchRef.current = feedbackRouteMatch;
36
36
  const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
37
- const checkoutItemsRef = useRef([]);
37
+ const checkoutItemsRef = useRef(undefined);
38
38
  /* This hook is mounted at this level, although not being used directly, for optimization (regarding cache) */
39
39
  useViewIsSizeChangeEnabledByCheckoutId({ checkoutId: checkout?.id });
40
40
  const [startCheckout] = useStartCheckout({ checkoutId: checkout?.id, logger });
@@ -55,9 +55,7 @@ const CheckoutMiddleware = ({ customerId, onNotAccessible, loader = React.create
55
55
  */
56
56
  const itemWithoutCustomerDecision = checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL &&
57
57
  checkoutItemsRef.current?.find((previousItem) => previousItem.id === item.id && previousItem.status !== CheckoutItemStatus.INITIAL)) || checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL);
58
- if (checkout?.items) {
59
- checkoutItemsRef.current = checkout.items;
60
- }
58
+ checkoutItemsRef.current = checkout?.items;
61
59
  /* Navigate to the summary if required */
62
60
  if (itemWithoutCustomerDecision === undefined &&
63
61
  !(summaryRouteMatchRef.current ||
@@ -1 +1 @@
1
- export declare const VERSION = "12.1.0";
1
+ export declare const VERSION = "12.1.2";
@@ -1 +1 @@
1
- export const VERSION = "12.1.0";
1
+ export const VERSION = "12.1.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "12.1.0",
3
+ "version": "12.1.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": "false",
@@ -50,7 +50,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
50
50
  feedbackRouteMatchRef.current = feedbackRouteMatch;
51
51
 
52
52
  const [checkout] = useViewFirstAvailableCheckoutByCustomerId({ customerId });
53
- const checkoutItemsRef = useRef<CheckoutItemProjection[]>([]);
53
+ const checkoutItemsRef = useRef<CheckoutItemProjection[] | undefined>(undefined);
54
54
 
55
55
  /* This hook is mounted at this level, although not being used directly, for optimization (regarding cache) */
56
56
  useViewIsSizeChangeEnabledByCheckoutId({ checkoutId: checkout?.id });
@@ -84,9 +84,7 @@ const CheckoutMiddleware: FC<CheckoutMiddlewareProps> = ({
84
84
  ),
85
85
  ) || checkout?.items.find((item) => item.status === CheckoutItemStatus.INITIAL);
86
86
 
87
- if (checkout?.items) {
88
- checkoutItemsRef.current = checkout.items;
89
- }
87
+ checkoutItemsRef.current = checkout?.items;
90
88
 
91
89
  /* Navigate to the summary if required */
92
90
  if (
@@ -710,7 +710,7 @@ exports[`ItemActions component matches the snapshot 1`] = `
710
710
  "opacity": 1,
711
711
  "transform": [
712
712
  {
713
- "translateY": 800,
713
+ "translateY": 1334,
714
714
  },
715
715
  {
716
716
  "scale": 1,