From 33c8aaf36f243619873d93701d3da0da54f12963 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 14 Sep 2018 04:06:23 -0400 Subject: [PATCH] do not display phone verification action for users who are already reward approved --- app/src/page/rewards/view.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/page/rewards/view.js b/app/src/page/rewards/view.js index 341f452..38bc67e 100644 --- a/app/src/page/rewards/view.js +++ b/app/src/page/rewards/view.js @@ -44,15 +44,22 @@ class RewardsPage extends React.PureComponent { const { user } = nextProps; this.setState({ verifyRequestStarted: false }); if (!emailVerifyErrorMessage) { - this.setState({ - isEmailVerified: true, - isRewardApproved: (user && user.is_reward_approved) - }); + this.setState({ isEmailVerified: true }); } + + // update other checks regardless of email verify result (due to fetching user data) + this.setState({ + isIdentityVerified: (user && user.is_identity_verified), + isRewardApproved: (user && user.is_reward_approved) + }); } } renderVerification() { + if (this.state.isRewardApproved) { + return null; + } + if (!this.state.isEmailVerified || !this.state.isIdentityVerified) { return (