From 78e3e81ddf01f41102f3f4e32c5a3955cf5fb04f Mon Sep 17 00:00:00 2001 From: jloup Date: Mon, 7 May 2018 18:50:53 +0200 Subject: Various fixes. --- cmd/web/js/poloniex.jsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'cmd/web/js') diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 76b68d8..edac368 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -4,7 +4,7 @@ import React from 'react'; class PoloniexController extends React.Component { constructor(props) { super(props); - this.state = {'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; + this.state = {'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; } loadBalance = () => { @@ -12,14 +12,14 @@ class PoloniexController extends React.Component { if (err) { console.error(err, data); if (err.code === 'invalid_market_credentials') { - this.setState({'flag': 'invalidCredentials', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); + this.setState({'flag': 'invalidCredentials', 'valueCurrency': null, 'balanceValue': null, 'balance': null}); } else if (err.code === 'ip_restricted_api_key') { - this.setState({'flag': 'ipRestricted', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); + this.setState({'flag': 'ipRestricted', 'valueCurrency': null, 'balanceValue': null, 'balance': null}); } return; } - this.setState({'flag': 'ok', 'apiRequested': true, 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance}); + this.setState({'flag': 'ok', 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance}); }.bind(this)); } @@ -41,9 +41,6 @@ class PoloniexController extends React.Component { default: displayText = null; } - if (this.state.apiRequested === false) { - return
; - } return (