diff --git a/common/containers/Tabs/Swap/index.js b/common/containers/Tabs/Swap/index.js index 1858dde5..07894f82 100644 --- a/common/containers/Tabs/Swap/index.js +++ b/common/containers/Tabs/Swap/index.js @@ -6,9 +6,9 @@ import { SWAP_DESTINATION_AMOUNT_TO, SWAP_DESTINATION_KIND_TO, SWAP_ORIGIN_AMOUNT_TO, + SWAP_ORIGIN_KIND_AND_DESTINATION_KIND_AND_DESTINATION_OPTIONS_TO, SWAP_ORIGIN_KIND_TO, - SWAP_UPDATE_BITY_RATES_TO, - SWAP_ORIGIN_KIND_AND_DESTINATION_KIND_AND_DESTINATION_OPTIONS_TO + SWAP_UPDATE_BITY_RATES_TO } from 'actions/swap'; import PropTypes from 'prop-types'; @@ -36,6 +36,17 @@ class Swap extends Component { swapOriginKindAndDestinationKindAndDestinationOptionsTo: PropTypes.func }; + componentDidMount() { + let {bityRates} = this.props; + + if (!bityRates.ETHBTC || !bityRates.ETHREP || !bityRates.BTCETH || !bityRates.BTCREP) { + this.bity.getAllRates() + .then((data) => { + this.props.swapUpdateBityRatesTo(data); + }) + } + } + render() { let { bityRates, @@ -67,14 +78,6 @@ class Swap extends Component { swapOriginKindAndDestinationKindAndDestinationOptionsTo }; - - if (!bityRates.ETHBTC || !bityRates.ETHREP || !bityRates.BTCETH || !bityRates.BTCREP) { - this.bity.getAllRates() - .then((data) => { - this.props.swapUpdateBityRatesTo(data); - }) - } - return (
diff --git a/common/index.jsx b/common/index.jsx index aef1ef3b..e025c889 100644 --- a/common/index.jsx +++ b/common/index.jsx @@ -37,6 +37,7 @@ const configureStore = () => { const renderRoot = (Root) => { let store = configureStore(); + window.store = store; let syncedHistory = syncHistoryWithStore(history, store); render(