aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/js
diff options
context:
space:
mode:
authorjloup <jeanloup.jamet@gmail.com>2018-02-25 18:43:48 +0100
committerjloup <jeanloup.jamet@gmail.com>2018-02-25 18:43:48 +0100
commitadf936f66a5c59e6cc2e7a1c644148e0f119e5c8 (patch)
tree003eb3e00b7e07cedbeedeea988fd362e7327ce7 /cmd/web/js
parent989fb5c7dbba174f54f3ae69df788d6685fff46b (diff)
downloadFront-adf936f66a5c59e6cc2e7a1c644148e0f119e5c8.tar.gz
Front-adf936f66a5c59e6cc2e7a1c644148e0f119e5c8.tar.zst
Front-adf936f66a5c59e6cc2e7a1c644148e0f119e5c8.zip
/not_confirmed page.
Diffstat (limited to 'cmd/web/js')
-rw-r--r--cmd/web/js/app.js4
-rw-r--r--cmd/web/js/main.jsx12
-rw-r--r--cmd/web/js/poloniex.jsx6
3 files changed, 21 insertions, 1 deletions
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) {
62 } 62 }
63 63
64 cookies.setItem('jwt', token, cookieExpire); 64 cookies.setItem('jwt', token, cookieExpire);
65 page('/not_confirmed');
65}; 66};
66 67
67App.getUserJWT = function() { 68App.getUserJWT = function() {
@@ -104,6 +105,9 @@ App.onUserNotAuthorized = function(httpCode, apiCode) {
104 case 'need_otp_validation': 105 case 'need_otp_validation':
105 page('/otp/validate'); 106 page('/otp/validate');
106 return false; 107 return false;
108 case 'user_not_confirmed':
109 page('/not_confirmed');
110 return false;
107 default: 111 default:
108 return true; 112 return true;
109 } 113 }
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) {
54 </div>); 54 </div>);
55}); 55});
56 56
57App.page('/not_confirmed', true, function(context) {
58 App.mount(<div>
59 <Logo />
60 <div className="row">
61 <div className="box offset-3 col-6 text-center">
62 <p>Please be patient, you account is being confirmed...</p>
63 <p><a href="/me"><u>Refresh</u></a></p>
64 </div>
65 </div>
66 </div>);
67});
68
57App.page('/otp/setup', true, function(context) { 69App.page('/otp/setup', true, function(context) {
58 Api.Call('OTP_ENROLL', {}, function(err, status, data) { 70 Api.Call('OTP_ENROLL', {}, function(err, status, data) {
59 if (err) { 71 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';
5class PoloniexController extends React.Component { 5class PoloniexController extends React.Component {
6 constructor(props) { 6 constructor(props) {
7 super(props); 7 super(props);
8 this.state = {'apiKey': '', 'apiSecret': '', 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null}; 8 this.state = {'apiKey': '', 'apiSecret': '', 'apiRequested': false, 'flag': 'loading', 'valueCurrency': null, 'balanceValue': null, 'balance': null};
9 } 9 }
10 10
11 handleCredentialsChange = (key, secret) => { 11 handleCredentialsChange = (key, secret) => {
@@ -43,6 +43,7 @@ class PoloniexController extends React.Component {
43 43
44 componentDidMount = () => { 44 componentDidMount = () => {
45 Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) { 45 Api.Call('MARKET', {'name': 'poloniex'}, function(err, status, data) {
46 this.setState({'apiRequested': true});
46 if (err) { 47 if (err) {
47 console.error(err, data); 48 console.error(err, data);
48 return; 49 return;
@@ -74,6 +75,9 @@ class PoloniexController extends React.Component {
74 default: 75 default:
75 displayText = null; 76 displayText = null;
76 } 77 }
78 if (this.state.apiRequested === false) {
79 return <div></div>;
80 }
77 return ( 81 return (
78 <div> 82 <div>
79 <PoloniexBalance balanceCurrency={this.state.valueCurrency} 83 <PoloniexBalance balanceCurrency={this.state.valueCurrency}