import { toPrevious } from 'app/actions/Card' ; import { getContentSets } from 'app/actions/Settings' ; import { CombatPhase } from 'app/Constants' ; import { AppStateWithHistory , CardName } from 'app/reducers/StateTypes' ; import { connect } from 'react-redux' ; import Redux from 'redux' ; import { ParserNode } from '../TemplateTypes' ; import { toCombatPhase } from './Actions' ; import Resolve , { DispatchProps , StateProps } from './Resolve' ; import { mapStateToProps as mapStateToPropsBase } from './Types' ; const mapStateToProps = ( state , ownProps ) : StateProps => { return { ... mapStateToPropsBase ( state , ownProps ) , mostRecentRolls : state . quest . node . ctx . templates . combat . mostRecentRolls , contentSets : getContentSets ( state . settings , state . multiplayer ) , } ; } ; const mapDispatchToProps = ( dispatch ) : DispatchProps => { return { onNext : ( node , phase ) => { dispatch ( toCombatPhase ( { node , phase } ) ) ; } , onReturn : ( ) => { dispatch ( toPrevious ( { before : false , matchFn : ( c , n ) => n . ctx . templates . combat . phase !== CombatPhase . timer } ) ) ; } , } ; } ; export default connect ( mapStateToProps , mapDispatchToProps ) ( Resolve ) ;