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:
commit
fe5d711fea
1 changed files with 11 additions and 4 deletions
|
@ -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]}>
|
||||||
|
|
Loading…
Reference in a new issue