Skip to content

Commit

Permalink
Fix handleApolloClient in case of modules is undefined, fixes #314
Browse files Browse the repository at this point in the history
  • Loading branch information
jhen0409 committed Feb 5, 2019
1 parent 89bff60 commit ca11116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/worker/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit ca11116

Please sign in to comment.