class PoloniexController extends React.Component {
constructor(props) {
super(props);
- this.state = {'apiKey': '', 'apiSecret': '', 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
+ this.state = {'apiKey': '', 'apiSecret': '', 'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
}
handleCredentialsChange = (key, secret) => {
componentDidMount = () => {
Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) {
+ this.setState({'apiRequested': true});
if (err) {
console.error(err, data);
return;
default:
displayText = null;
}
+ if (this.state.apiRequested === false) {
+ return <div></div>;
+ }
return (
<div>
<PoloniexBalance balanceCurrency={this.state.valueCurrency}