diff --git a/src/App.js b/src/App.js index 607872f..ac45eaa 100644 --- a/src/App.js +++ b/src/App.js @@ -19,6 +19,7 @@ export const siteTitle = 'HyperStatic' class App extends Component { componentWillMount () { globalStyles() + import('./netlifyIdentity') } render () { diff --git a/src/index.js b/src/index.js index 841aab3..b34a9f7 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,6 @@ import React from 'react' import { render } from 'react-snapshot' import App from './App' import registerServiceWorker from './registerServiceWorker' -import './netlifyIdentity' const rootEl = document.getElementById('root') render(, rootEl) diff --git a/src/netlifyIdentity.js b/src/netlifyIdentity.js index 39f6ba8..6022436 100644 --- a/src/netlifyIdentity.js +++ b/src/netlifyIdentity.js @@ -9,4 +9,6 @@ netlifyIdentity.on('init', user => { } }) -netlifyIdentity.init() +if (window.localStorage) { + netlifyIdentity.init() +}