diff --git a/packages/fether-react/src/App/App.js b/packages/fether-react/src/App/App.js index 5a842a4bf..a41634b62 100644 --- a/packages/fether-react/src/App/App.js +++ b/packages/fether-react/src/App/App.js @@ -28,7 +28,7 @@ const Router = process.env.NODE_ENV === 'production' ? MemoryRouter : BrowserRouter; const electron = isElectron() ? window.require('electron') : null; -@inject('onboardingStore') +@inject('onboardingStore', 'parityStore') @observer class App extends Component { handleResize = (_, height) => { @@ -44,9 +44,19 @@ class App extends Component { */ render () { const { - onboardingStore: { isFirstRun } + onboardingStore: { isFirstRun }, + parityStore: { api } } = this.props; + // The child components make use of light.js and light.js needs to be passed + // an API first, otherwise it will throw an error. + // We set parityStore.api right after we set the API for light.js, so we + // verify here that parityStore.api is defined, and if not we don't render + // the children. + if (!api) { + return null; + } + if (isFirstRun) { return (