X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fpoloniex.jsx;h=482dbb6c9b437ca2f0bf2af7e93ed2378810ff55;hb=6b3f0ad04550060fd25b87b68c3f9bc1602f3226;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..482dbb6 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -1,11 +1,10 @@ import Api from './api.js'; -import classNames from 'classnames'; 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 +42,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 +74,9 @@ class PoloniexController extends React.Component { default: displayText = null; } + if (this.state.apiRequested === false) { + return
; + } return (