From adf936f66a5c59e6cc2e7a1c644148e0f119e5c8 Mon Sep 17 00:00:00 2001 From: jloup Date: Sun, 25 Feb 2018 18:43:48 +0100 Subject: /not_confirmed page. --- cmd/web/js/app.js | 4 ++++ cmd/web/js/main.jsx | 12 ++++++++++++ cmd/web/js/poloniex.jsx | 6 +++++- 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'cmd/web/js') diff --git a/cmd/web/js/app.js b/cmd/web/js/app.js index 8573b6e..d8189e0 100644 --- a/cmd/web/js/app.js +++ b/cmd/web/js/app.js @@ -62,6 +62,7 @@ App.onUserSignUp = function(token) { } cookies.setItem('jwt', token, cookieExpire); + page('/not_confirmed'); }; App.getUserJWT = function() { @@ -104,6 +105,9 @@ App.onUserNotAuthorized = function(httpCode, apiCode) { case 'need_otp_validation': page('/otp/validate'); return false; + case 'user_not_confirmed': + page('/not_confirmed'); + return false; default: return true; } diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index 827b83d..79bf976 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -54,6 +54,18 @@ App.page('/me', true, function(context) { ); }); +App.page('/not_confirmed', true, function(context) { + App.mount(
+ +
+
+

Please be patient, you account is being confirmed...

+

Refresh

+
+
+
); +}); + App.page('/otp/setup', true, function(context) { Api.Call('OTP_ENROLL', {}, function(err, status, data) { if (err) { diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 96384fd..a5fb9a7 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 (