do not display phone verification action for users who are already reward approved

This commit is contained in:
Akinwale Ariwodola 2018-09-14 04:06:23 -04:00
parent d5366b10fa
commit 33c8aaf36f

View file

@ -44,15 +44,22 @@ class RewardsPage extends React.PureComponent {
const { user } = nextProps; const { user } = nextProps;
this.setState({ verifyRequestStarted: false }); this.setState({ verifyRequestStarted: false });
if (!emailVerifyErrorMessage) { if (!emailVerifyErrorMessage) {
this.setState({ this.setState({ isEmailVerified: true });
isEmailVerified: true,
isRewardApproved: (user && user.is_reward_approved)
});
} }
// 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() { renderVerification() {
if (this.state.isRewardApproved) {
return null;
}
if (!this.state.isEmailVerified || !this.state.isIdentityVerified) { if (!this.state.isEmailVerified || !this.state.isIdentityVerified) {
return ( return (
<View style={[rewardStyle.card, rewardStyle.verification]}> <View style={[rewardStyle.card, rewardStyle.verification]}>