Skip to content

Commit 01c533b

Browse files
committed
Fix bug where cart won't update immediately after a quantity update
1 parent 4736991 commit 01c533b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

components/Cart/CartPage/CartItemsContainer.component.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ const CartItemsContainer = () => {
6767
},
6868
});
6969

70-
// Clear out the cart in localStorage and the cart to null
71-
if(updatedItems[0].quantity === 0 && process.browser) {
72-
setCart(null)
73-
localStorage.removeItem('woocommerce-cart')
74-
localStorage.removeItem('woo-session')
75-
}
70+
71+
7672
}
7773
};
7874

7975
const { loading, error, data, refetch } = useQuery(GET_CART, {
76+
notifyOnNetworkStatusChange: true,
8077
onCompleted: () => {
8178
// Update cart in the localStorage.
8279
const updatedCart = getFormattedCart(data);

0 commit comments

Comments
 (0)