address additional comments
This commit is contained in:
parent
c77f5ef300
commit
3cf43d04ad
|
@ -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 (
|
||||
<section className="container" style={{minHeight: '50%'}}>
|
||||
<div className="tab-content">
|
||||
|
|
|
@ -37,6 +37,7 @@ const configureStore = () => {
|
|||
|
||||
const renderRoot = (Root) => {
|
||||
let store = configureStore();
|
||||
window.store = store;
|
||||
let syncedHistory = syncHistoryWithStore(history, store);
|
||||
render(
|
||||
<Root key={Math.random()}
|
||||
|
|
Loading…
Reference in New Issue