From 299b6b6d9fb879c06e675ef240f361348629ff6c Mon Sep 17 00:00:00 2001 From: jloup Date: Thu, 10 May 2018 16:22:29 +0200 Subject: Add column 'status' to market_configs. --- cmd/web/js/account.jsx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmd/web/js') 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; } -- cgit v1.2.3