X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fpoloniex.jsx;h=c0b68c706671842dcfd0c94a6401d0c8dcb3b104;hb=b2e9bce00231489ef507927eceb9207285cd2fe4;hp=96384fd35ac501ee62a918a2620c90d5af9d3564;hpb=989fb5c7dbba174f54f3ae69df788d6685fff46b;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 96384fd..c0b68c7 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -5,7 +5,7 @@ import React from 'react'; 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) => { @@ -43,6 +43,7 @@ class PoloniexController extends React.Component { componentDidMount = () => { Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) { + this.setState({'apiRequested': true}); if (err) { console.error(err, data); return; @@ -74,6 +75,9 @@ class PoloniexController extends React.Component { default: displayText = null; } + if (this.state.apiRequested === false) { + return
; + } return (
-
+
Poloniex credentials