From 8f2c595eca30e2d7138c8e8d6685774a8f44e55d Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 15 Feb 2018 16:59:58 -0500 Subject: omg --- frontend/lib/image.js | 6 ------ frontend/lib/initApollo.js | 15 +++++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 frontend/lib/image.js (limited to 'frontend/lib') diff --git a/frontend/lib/image.js b/frontend/lib/image.js deleted file mode 100644 index 5b6efb9..0000000 --- a/frontend/lib/image.js +++ /dev/null @@ -1,6 +0,0 @@ -import { imageEndpoint } from '../config'; - -export default function(image, width = 300, height = 300) { - if (!image || !image.secret) return ''; - return `${imageEndpoint}/${image.secret}/${width}x${height}`; -} diff --git a/frontend/lib/initApollo.js b/frontend/lib/initApollo.js index 45f0fec..e86c7e1 100644 --- a/frontend/lib/initApollo.js +++ b/frontend/lib/initApollo.js @@ -20,20 +20,19 @@ function create(initialState) { const stateLink = withClientState({ cache, defaults: { - networkStatus: { - __typename: 'NetworkStatus', + uiData: { + __typename: 'UIData', isConnected: true, - isCartOpen: true, + isCartOpen: false, }, }, resolvers: { Mutation: { - updateNetworkStatus: (_, { isConnected }, { cache }) => { - console.log(isConnected); + setLocalData: (_, values, { cache }) => { const data = { - networkStatus: { - __typename: 'NetworkStatus', - isConnected, + uiData: { + __typename: 'UIData', + ...values, }, }; cache.writeData({ data }); -- cgit v1.3