Skip to content

Commit 9740708

Browse files
committed
Update CheckoutForm.component.tsx
1 parent 69d0e47 commit 9740708

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/components/Checkout/CheckoutForm.component.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,9 @@ const CheckoutForm = () => {
5959
// Get cart data query
6060
const { data } = useQuery(GET_CART, {
6161
notifyOnNetworkStatusChange: true,
62-
onCompleted: () => {
62+
onCompleted: (data) => {
6363
const updatedCart = getFormattedCart(data) as RootObject | undefined;
64-
if (!updatedCart || !data.cart.contents.nodes.length) {
65-
setCart(null);
66-
return;
67-
}
68-
setCart(updatedCart as RootObject);
64+
setCart(updatedCart || null);
6965
},
7066
});
7167

0 commit comments

Comments
 (0)