X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Faccount.jsx;h=03ca117b756db7a222ddf21b5d1e76d7ecc0ff13;hb=299b6b6d9fb879c06e675ef240f361348629ff6c;hp=d30abe7e229a157a627aab99a8c55f55c33cd329;hpb=3b8833854f83f75e3d16c1fdb869937f690e48ea;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/account.jsx b/cmd/web/js/account.jsx index d30abe7..03ca117 100644 --- a/cmd/web/js/account.jsx +++ b/cmd/web/js/account.jsx @@ -28,9 +28,15 @@ class PoloniexConfiguration extends React.Component { } handleCredentialsSubmit = () => { + this.setState({'status': 'loading'}); Api.Call('UPDATE_MARKET', {'key': this.state.apiKey, 'secret': this.state.apiSecret, 'name': 'poloniex'}, function(err, status, data) { if (err) { console.error(err, data); + if (err.code === 'invalid_market_credentials') { + this.setState({'status': 'invalidCredentials'}); + } else if (err.code === 'ip_restricted_api_key') { + this.setState({'status': 'ipRestricted'}); + } return; }