From ec1377850eb084fbc8ab70e98389b6215c692870 Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Sat, 3 Oct 2020 19:59:15 -0500 Subject: [PATCH] Updated cart hook --- lib/bigcommerce/cart.tsx | 9 +++++++-- lib/commerce/cart.tsx | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/bigcommerce/cart.tsx b/lib/bigcommerce/cart.tsx index d57736e91..1b5f6b47e 100644 --- a/lib/bigcommerce/cart.tsx +++ b/lib/bigcommerce/cart.tsx @@ -7,9 +7,14 @@ import { export type Cart = any export const CartProvider: FC = ({ children }) => { - return {children} + return {children} } export function useCart() { - return useCommerceCart() + const cart = useCommerceCart() + + // TODO: Do something to make this prop work + cart.isEmpty = true + + return cart } diff --git a/lib/commerce/cart.tsx b/lib/commerce/cart.tsx index 8c1335780..c11ecd017 100644 --- a/lib/commerce/cart.tsx +++ b/lib/commerce/cart.tsx @@ -21,11 +21,9 @@ const CartProvider: FC = ({ children, query, url }) => { const { fetcher } = useCommerce() const cartId = getCartCookie() const response = useSWR(() => (cartId ? [url, query] : null), fetcher) - // TODO: Do something to make this prop work - const isEmpty = true return ( - + {children} )