From 1156034b0ea3eb8b4dae28536b20f58dc55deb6c Mon Sep 17 00:00:00 2001 From: enggar_ganteng Date: Mon, 28 Jan 2019 21:10:53 +0700 Subject: [PATCH] update : otp interface --- src/common/pages/Otp/index.js | 16 ++++++++++++++-- src/common/stores/authenticaton.js | 5 ++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/common/pages/Otp/index.js b/src/common/pages/Otp/index.js index 193a460..9329a15 100644 --- a/src/common/pages/Otp/index.js +++ b/src/common/pages/Otp/index.js @@ -60,7 +60,10 @@ class OtpPage extends React.Component{ }; resendCode = () => { - + this.setState({isResending:true}); + setTimeout(()=>{ + this.setState({isResending:false}); + },3000); } login = () => { @@ -89,6 +92,15 @@ class OtpPage extends React.Component{ const { classes } = this.props; return (
+ this.setState({isResending:false})} + ContentProps={{ + 'aria-describedby': 'message-id', + }} + message={OTP Code Re-sended} + /> @@ -112,7 +124,7 @@ class OtpPage extends React.Component{ Input Your OTP Code - Still not received OTP Code? Resend Code + Still not received OTP Code? this.resendCode()}>Resend Code {[0, 1, 2, 3, 4, 5].map(x => ( diff --git a/src/common/stores/authenticaton.js b/src/common/stores/authenticaton.js index c89120f..2bd8acb 100644 --- a/src/common/stores/authenticaton.js +++ b/src/common/stores/authenticaton.js @@ -1,5 +1,6 @@ import { observable, action, computed} from 'mobx'; import * as fetch from 'isomorphic-fetch'; +import { resolve } from 'url'; export class Authentication { @@ -8,7 +9,7 @@ export class Authentication { @observable isLoggingIn = false; @observable isInviting = false; @observable removingUser = false; - + @observable isNeedEmailVerification = false; @observable userWallet = {}; @observable userProfile = { email : '', @@ -50,8 +51,10 @@ export class Authentication { return this.http.post("authentication/login", data) .then(res => { this.isLoggingIn = false; + this.isNeedEmailVerification = res.need_email_verification; this.context.setToken(res.token); this.context.loadDataAfterLogin(); + return res; }) .catch(err => { this.isLoggingIn = false;