From 6f44adb59d3542eb21e55e0aae789b1fcc7cf8f1 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Tue, 24 Oct 2017 13:55:26 -0400 Subject: add to cart --- components/AddToCart.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'components') diff --git a/components/AddToCart.js b/components/AddToCart.js index 9bcdb7f..ae5b87f 100644 --- a/components/AddToCart.js +++ b/components/AddToCart.js @@ -62,8 +62,7 @@ class AddToCart extends Component { render() { const user = this.props.currentUserQuery.user; - - if (!user) return

Loading...

; + if (!user || this.props.singleItemQuery.loading) return

Loading...

; const cartIds = user.cart.map(item => item.id); const image = this.props.singleItemQuery.Item.image; const isInCart = cartIds.includes(this.props.id); -- cgit v1.3