do not attempt claim rewards when user is not approved
This commit is contained in:
parent
2b29005d76
commit
1b87dd24fd
1 changed files with 5 additions and 3 deletions
|
@ -85,12 +85,14 @@ export function doClaimRewardType(rewardType) {
|
|||
|
||||
export function doClaimEligiblePurchaseRewards() {
|
||||
return function(dispatch, getState) {
|
||||
if (!lbryio.enabled) {
|
||||
const state = getState(),
|
||||
rewardsByType = selectUnclaimedRewardsByType(state),
|
||||
userIsRewardApproved = selectUserIsRewardApproved(state);
|
||||
|
||||
if (!userIsRewardApproved || !lbryio.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rewardsByType = selectUnclaimedRewardsByType(getState());
|
||||
|
||||
if (rewardsByType[rewards.TYPE_FIRST_STREAM]) {
|
||||
dispatch(doClaimRewardType(rewards.TYPE_FIRST_STREAM));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue