Merge pull request #293 from lbryio/rewards-eligible-check

do not display phone verification action for users who are already reward approved
This commit is contained in:
Akinwale Ariwodola 2018-09-14 08:58:07 -04:00 committed by GitHub
commit fe5d711fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 (
<View style={[rewardStyle.card, rewardStyle.verification]}>