summaryrefslogtreecommitdiffstats
path: root/frontend
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-05-16 13:55:34 -0400
committerWes Bos <wesbos@gmail.com>2018-05-16 13:55:34 -0400
commitf2e0263ee2d32b156a7a3b14770b897801c87553 (patch)
tree1879b47e2afa8c1c7eff2f7c65ec4a9a6d5b9462 /frontend
parentfceade857ecccad6884fe03a973215bd9df1a1e7 (diff)
last TODO
Diffstat (limited to 'frontend')
-rw-r--r--frontend/components/Cart.js8
-rw-r--r--frontend/components/TakeMyMoney.js1
-rw-r--r--frontend/lib/withData.js4
3 files changed, 6 insertions, 7 deletions
diff --git a/frontend/components/Cart.js b/frontend/components/Cart.js
index 059ec39..2230a0e 100644
--- a/frontend/components/Cart.js
+++ b/frontend/components/Cart.js
@@ -4,7 +4,11 @@ import { adopt } from 'react-adopt';
import TakeMyMoney from './TakeMyMoney';
import formatMoney from '../lib/formatMoney';
import CartItem from './CartItem';
-import { CURRENT_USER_QUERY, LOCAL_STATE_QUERY, TOGGLE_CART_MUTATION } from '../queries/queries.graphql';
+import {
+ CURRENT_USER_QUERY,
+ LOCAL_STATE_QUERY,
+ TOGGLE_CART_MUTATION,
+} from '../queries/queries.graphql';
import calcTotalPrice from '../lib/calcTotalPrice';
import Error from './ErrorMessage';
import CartStyles from './styles/CartStyles';
@@ -28,7 +32,7 @@ const Cart = () => (
const { data: { me }, error, loading } = currentUser;
if (loading) return <p>Loading...</p>;
if (error) return <Error error={error} />;
- if (!me) return <p>Please Sign In!</p>;
+ if (!me) return null;
return (
<CartStyles open={localState.data.cartOpen}>
<header>
diff --git a/frontend/components/TakeMyMoney.js b/frontend/components/TakeMyMoney.js
index 4675cfe..fef90de 100644
--- a/frontend/components/TakeMyMoney.js
+++ b/frontend/components/TakeMyMoney.js
@@ -27,7 +27,6 @@ class TakeMyMoney extends Component {
query: { id },
});
};
- // TODO - refetchQueries after an order is created
render() {
return (
<Query query={CURRENT_USER_QUERY}>
diff --git a/frontend/lib/withData.js b/frontend/lib/withData.js
index 585cee7..6c215af 100644
--- a/frontend/lib/withData.js
+++ b/frontend/lib/withData.js
@@ -7,10 +7,6 @@ function createClient({ headers }) {
return new ApolloClient({
uri: process.env.NODE_ENV === 'development' ? 'http://localhost:4444' : 'http://localhost:4444',
ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once)
- // TODO this is a bug: https://github.com/apollographql/apollo-client/issues/3265
- fetchOptions: {
- credentials: 'include',
- },
request: async operation => {
operation.setContext({
fetchOptions: {