From ad3671675719eb11a81245bffbe0fb18880b479b Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Tue, 8 May 2018 13:00:51 -0400 Subject: omg --- frontend/components/Cart.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'frontend/components/Cart.js') diff --git a/frontend/components/Cart.js b/frontend/components/Cart.js index 26f1015..8d57c33 100644 --- a/frontend/components/Cart.js +++ b/frontend/components/Cart.js @@ -6,6 +6,7 @@ import formatMoney from '../lib/formatMoney'; import CartItem from './CartItem'; import { CURRENT_USER_QUERY, LOCAL_STATE_QUERY, TOGGLE_CART_MUTATION } from '../queries/queries'; import calcTotalPrice from '../lib/calcTotalPrice'; +import Error from './ErrorMessage'; const CartStyles = styled.div` padding: 20px; @@ -78,9 +79,11 @@ const Cart = props => ( {toggle => ( {({ data }) => ( - + {({ data: { me }, error, loading }) => { - if (loading || error || !me) return null; + if (loading) return

Loading...

; + if (error) return ; + if (!me) return

Please Sign In!

; return (
-- cgit v1.3