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}
return (
<div className="row api-credentials-form">
- <div className="offset-3 col-6 box">
+ <div className="offset-2 col-8 box">
<span className="text-center">Poloniex credentials</span>
<hr/>
<form role="form" onSubmit={this.handleSubmit}>