Skip to content

Commit ba20e6e

Browse files
committed
Fix cart bug
1 parent d8e3654 commit ba20e6e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

refactor/src/components/Layout/Layout.component.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ const Layout = ({ children, title }: ILayoutProps) => {
4040
const updatedCart = getFormattedCart(data);
4141

4242
if (!updatedCart && !data?.cart?.contents?.nodes.length) {
43-
// Clear the localStorage if we have no remote cart
43+
// Should we clear the localStorage if we have no remote cart?
4444

45-
localStorage.removeItem('woocommerce-cart');
46-
setCart(null);
4745
return;
4846
}
4947

0 commit comments

Comments
 (0)