updated createStore to handle browsers with no webtools

This commit is contained in:
bill bittner 2018-02-07 08:28:43 -08:00
parent dbcf4e4c46
commit d809173b00
3 changed files with 10 additions and 13 deletions

View file

@ -6,11 +6,6 @@ class AssetDisplay extends React.Component {
componentDidMount () { componentDidMount () {
this.props.onFileRequest(this.props.claimData.name, this.props.claimData.claimId); this.props.onFileRequest(this.props.claimData.name, this.props.claimData.claimId);
} }
componentWillReceiveProps (nextProps) {
// if (nextProps.name !== this.props.name && nextProps.claimId !== this.props.claimId) {
// this.props.onCheckServerForFile(nextProps.name, nextProps.claimId);
// }
}
render () { render () {
const status = this.props.status; const status = this.props.status;
const error = this.props.error; const error = this.props.error;

View file

@ -2,14 +2,14 @@ import { connect } from 'react-redux';
import { updateChannelClaimsData } from 'actions/show'; import { updateChannelClaimsData } from 'actions/show';
import View from './view'; import View from './view';
const mapStateToProps = ({ show }) => { const mapStateToProps = ({ show : { showChannel: { channelData, channelClaimsData } } }) => {
return { return {
name : show.showChannel.channelData.name, name : channelData.name,
longId : show.showChannel.channelData.longId, longId : channelData.longId,
claims : show.showChannel.channelClaimsData.claims, claims : channelClaimsData.claims,
currentPage: show.showChannel.channelClaimsData.currentPage, currentPage: channelClaimsData.currentPage,
totalPages : show.showChannel.channelClaimsData.totalPages, totalPages : channelClaimsData.totalPages,
totalClaims: show.showChannel.channelClaimsData.totalClaims, totalClaims: channelClaimsData.totalClaims,
}; };
}; };

View file

@ -9,9 +9,11 @@ import Root from './root';
const sagaMiddleware = createSagaMiddleware(); const sagaMiddleware = createSagaMiddleware();
const middleware = applyMiddleware(sagaMiddleware); const middleware = applyMiddleware(sagaMiddleware);
const enhancer = window.__REDUX_DEVTOOLS_EXTENSION__ ? compose(middleware, window.__REDUX_DEVTOOLS_EXTENSION__()) : middleware;
let store = createStore( let store = createStore(
Reducer, Reducer,
compose(middleware, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()), enhancer,
); );
sagaMiddleware.run(rootSaga); sagaMiddleware.run(rootSaga);