Commit f3d9d484 authored by Andrew Hrdy's avatar Andrew Hrdy
Browse files

Fixed error where webpage crashes if the Redux dev extension is not installed.

parent b0644f33
...@@ -17,17 +17,16 @@ import amber from 'material-ui/colors/amber'; ...@@ -17,17 +17,16 @@ import amber from 'material-ui/colors/amber';
import red from 'material-ui/colors/red'; import red from 'material-ui/colors/red';
import green from 'material-ui/colors/green'; import green from 'material-ui/colors/green';
// Create a history of your choosing (we're using a browser history in this case) // Create a history of your choosing (we're using a browser history in this case)
const history = createHistory() const history = createHistory();
const extension = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(); const extension = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
if(extension){ if(extension){
const enhance = compose( const enhance = compose(
applyMiddleware(ReduxThunk,routerMiddleware(history)) applyMiddleware(ReduxThunk,routerMiddleware(history))
,extension) ,extension);
} }
const enhance = compose( const enhance = compose(
applyMiddleware(ReduxThunk,routerMiddleware(history)) applyMiddleware(ReduxThunk,routerMiddleware(history)));
,extension) const store = createStore(reducers,enhance);
const store = createStore(reducers,enhance)
const theme = createMuiTheme({ const theme = createMuiTheme({
palette: {primary:blue,secondary:green,warn:amber,error:red,type:'light'} palette: {primary:blue,secondary:green,warn:amber,error:red,type:'light'}
......
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