Commit b50d4f42 authored by Andrew Hrdy's avatar Andrew Hrdy

Redux dev tools not loaded in production, google analytics not loaded in develop.

parent 4958b167
Pipeline #2016 passed with stages
in 1 minute and 55 seconds
......@@ -33,14 +33,6 @@
</head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112607180-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-112607180-1');
</script>
<body>
<noscript>
......
......@@ -17,13 +17,17 @@ import 'typeface-roboto';
// Create a history of your choosing (we're using a browser history in this case)
const history = createHistory();
const extension = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
const isProduction = process.env.NODE_ENV === 'production';
let enhance;
const enhance = compose(applyMiddleware(ReduxThunk, routerMiddleware(history)), !isProduction && extension);
if (extension) {
enhance = compose(applyMiddleware(ReduxThunk, routerMiddleware(history)), extension);
} else {
enhance = compose(applyMiddleware(ReduxThunk, routerMiddleware(history)));
if (isProduction) {
window.dataLayer = window.dataLayer || [];
const gtag = (args) => {
window.dataLayer.push(args);
};
gtag('js', new Date());
gtag('config', 'UA-112607180-1');
}
const store = createStore(reducers, enhance);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment