File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
resources/js/store/modules Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -16724,7 +16724,8 @@ var mutations = {
1672416724 window.location.reload();
1672516725 },
1672616726 UPDATE_CART: function UPDATE_CART(state, cart) {
16727- Object.assign(state.cart, cart);
16727+ var newState = state;
16728+ newState.cart = cart;
1672816729 },
1672916730 UPDATE_ORDER: function UPDATE_ORDER(state, order) {
1673016731 Object.assign(state.order, order);
Original file line number Diff line number Diff line change @@ -4,19 +4,18 @@ const mutations = {
44 window . location . reload ( ) ;
55 } ,
66 UPDATE_CART ( state , cart ) {
7- Object . assign ( state . cart , cart ) ;
7+ const newState = state ;
8+ newState . cart = cart ;
89 } ,
910 UPDATE_ORDER ( state , order ) {
1011 Object . assign ( state . order , order ) ;
1112 } ,
1213 ADD_PRODUCT_TO_CART ( { cart } , payload ) {
1314 // ESLint complains if we modify the state directly
1415 const cartCopy = cart ;
15-
1616 const foundProductInCartIndex = cart . findIndex (
1717 ( item ) => item . slug === payload . slug ,
1818 ) ;
19-
2019 if ( foundProductInCartIndex > - 1 ) {
2120 cartCopy [ foundProductInCartIndex ] . quantity += 1 ;
2221 return cartCopy ;
You can’t perform that action at this time.
0 commit comments