From ca11116172b8bb8a2dd57294cbb76c0369436910 Mon Sep 17 00:00:00 2001 From: jhen Date: Wed, 6 Feb 2019 06:31:48 +0800 Subject: [PATCH] Fix handleApolloClient in case of modules is undefined, fixes #314 --- app/worker/apollo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/worker/apollo.js b/app/worker/apollo.js index 91635f44..cede0a8d 100644 --- a/app/worker/apollo.js +++ b/app/worker/apollo.js @@ -3,7 +3,7 @@ import { initBackend, sendBridgeReady } from 'apollo-client-devtools/src/backend import { version as devToolsVersion } from 'apollo-client-devtools/package.json'; import { getSafeAsyncStorage } from './asyncStorage'; -export function handleApolloClient(modules) { +export function handleApolloClient({ AsyncStorage } = {}) { const interval = setInterval(() => { if (!self.__APOLLO_CLIENT__) { return; @@ -42,7 +42,7 @@ export function handleApolloClient(modules) { self.removeEventListener('message', listener); }); - initBackend(bridge, hook, getSafeAsyncStorage(modules.AsyncStorage)); + initBackend(bridge, hook, getSafeAsyncStorage(AsyncStorage)); }, 1000); return interval; }