Skip to content

Commit

Permalink
fix: debug CartReducer TypeError: Cannot read properties of undefined…
Browse files Browse the repository at this point in the history
… L163
  • Loading branch information
nicolelst committed Jun 11, 2023
1 parent 54b1bbd commit fe62872
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/web/features/merch/context/cart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const CartProvider: React.FC<CartProviderProps> = ({ children }) => {
(JSON.parse(
localStorage.getItem("cart") as string
) as typeof initState) ?? cartState;
cartState.cart.items = storedCartData.cart.items;
cartState.cart.items = storedCartData.cart?.items;
cartState.name = storedCartData.name;
cartState.billingEmail = storedCartData.billingEmail;
dispatch({ type: CartActionType.INITALIZE, payload: cartState });
Expand Down

0 comments on commit fe62872

Please sign in to comment.