aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/js/poloniex.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/js/poloniex.jsx')
-rw-r--r--cmd/web/js/poloniex.jsx11
1 files changed, 4 insertions, 7 deletions
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';
4class PoloniexController extends React.Component { 4class PoloniexController extends React.Component {
5 constructor(props) { 5 constructor(props) {
6 super(props); 6 super(props);
7 this.state = {'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; 7 this.state = {'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
8 } 8 }
9 9
10 loadBalance = () => { 10 loadBalance = () => {
@@ -12,14 +12,14 @@ class PoloniexController extends React.Component {
12 if (err) { 12 if (err) {
13 console.error(err, data); 13 console.error(err, data);
14 if (err.code === 'invalid_market_credentials') { 14 if (err.code === 'invalid_market_credentials') {
15 this.setState({'flag': 'invalidCredentials', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); 15 this.setState({'flag': 'invalidCredentials', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
16 } else if (err.code === 'ip_restricted_api_key') { 16 } else if (err.code === 'ip_restricted_api_key') {
17 this.setState({'flag': 'ipRestricted', 'apiRequested': true, 'valueCurrency': null, 'balanceValue': null, 'balance': null}); 17 this.setState({'flag': 'ipRestricted', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
18 } 18 }
19 return; 19 return;
20 } 20 }
21 21
22 this.setState({'flag': 'ok', 'apiRequested': true, 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance}); 22 this.setState({'flag': 'ok', 'valueCurrency': data.valueCurrency, 'balanceValue': data.value, 'balance': data.balance});
23 }.bind(this)); 23 }.bind(this));
24 } 24 }
25 25
@@ -41,9 +41,6 @@ class PoloniexController extends React.Component {
41 default: 41 default:
42 displayText = null; 42 displayText = null;
43 } 43 }
44 if (this.state.apiRequested === false) {
45 return <div></div>;
46 }
47 return ( 44 return (
48 <div> 45 <div>
49 <PoloniexBalance balanceCurrency={this.state.valueCurrency} 46 <PoloniexBalance balanceCurrency={this.state.valueCurrency}