From 908ee2dd22c85d5d850f62b1a9d0066b43b80a69 Mon Sep 17 00:00:00 2001
From: jloup <jeanloup.jamet@gmail.com>
Date: Mon, 26 Mar 2018 10:54:48 +0200
Subject: Handle poloniex ip restriction.

---
 cmd/web/js/poloniex.jsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'cmd/web/js/poloniex.jsx')

diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx
index 482dbb6..813a506 100644
--- a/cmd/web/js/poloniex.jsx
+++ b/cmd/web/js/poloniex.jsx
@@ -32,6 +32,8 @@ class PoloniexController extends React.Component {
         console.error(err, data);
         if (err.code === 'invalid_market_credentials') {
           this.setState({'flag': 'invalidCredentials', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
+        } else if (err.code === 'ip_restricted_api_key') {
+          this.setState({'flag': 'ipRestricted', 'valueCurrency': null, 'balanceValue': null, 'balance': null});
         }
         return;
       }
@@ -68,6 +70,9 @@ class PoloniexController extends React.Component {
       case 'invalidCredentials':
         displayText = 'Invalid poloniex credentials';
         break;
+      case 'ipRestricted':
+        displayText = 'Your API key is IP restricted. Please whitelist us.';
+        break;
       case 'emptyCredentials':
         displayText = 'Please provide poloniex credentials';
         break;
-- 
cgit v1.2.3

