From d066f8b726221bcaec18a8847582b54749d0e48e Mon Sep 17 00:00:00 2001 From: vera-liu Date: Fri, 30 Sep 2016 15:02:52 -0700 Subject: [PATCH] Added alert to install redux devtool (#1228) * Added alert to install redux devtool * Change to warning --- caravel/assets/javascripts/reduxUtils.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/caravel/assets/javascripts/reduxUtils.js b/caravel/assets/javascripts/reduxUtils.js index e247d0b9e8..16f0046bb5 100644 --- a/caravel/assets/javascripts/reduxUtils.js +++ b/caravel/assets/javascripts/reduxUtils.js @@ -67,9 +67,15 @@ export function addToArr(state, arrKey, obj) { export function enhancer() { let enhancerWithPersistState = compose(persistState()); if (process.env.NODE_ENV === 'dev') { - enhancerWithPersistState = compose( - persistState(), window.devToolsExtension && window.devToolsExtension() - ); + if (window.devToolsExtension) { + enhancerWithPersistState = compose( + persistState(), window.devToolsExtension && window.devToolsExtension() + ); + } else { + console.warn('You may encounter errors unless' + + 'you have Redux Devtool Extension installed: ' + + 'http://github.com/zalmoxisus/redux-devtools-extension'); + } } return enhancerWithPersistState; }