Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Check whether orderNotes have changed before creating a new state object
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Jul 30, 2020
1 parent ca9096c commit 66f3d33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions assets/js/base/context/cart-checkout/checkout-state/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ export const reducer = (
};
break;
case SET_ORDER_NOTES:
newState = {
...state,
orderNotes,
};
if ( state.orderNotes !== orderNotes ) {
newState = {
...state,
orderNotes,
};
}
break;
}
// automatically update state to idle from pristine as soon as it
Expand Down

0 comments on commit 66f3d33

Please sign in to comment.