New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewards look grayed out #1466

Closed
tzarebczan opened this Issue May 9, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@tzarebczan
Member

tzarebczan commented May 9, 2018

The Issue

This happened to myself and a community member last week and just recently for @nikooo777 , see below. It's not currently happening and not sure how to reproduce.

me:
screenshot-2018-5-4 drafts 49 - thomas zarebczan gmail com - gmail
Niko:
niko

System Configuration

  • LBRY Daemon version:
  • LBRY App version:
  • LBRY Installation ID:
  • Operating system:

Anything Else

Screenshots

@dan1d

This comment has been minimized.

Show comment
Hide comment
@dan1d

dan1d May 15, 2018

Contributor

Hi @tzarebczan

Currently I have an account that I can reproduce this bug, I see the rewards cards greyed out.
I've figured what's the issue but I'm not entirely sure what's the best approach to fix this:
on this file src/renderer/page/rewards/view.jsx


This code is the one that puts the gray layout on top of the rewards:
const isNotEligible =
      !user || !user.primary_email || !user.has_verified_email || !user.is_identity_verified; // I have all of them except is_identity_verified which is false so it returns true !, so I'm not elegible for rewards and that code add the class card--disabled.

    return (
      <div
        className={classnames('card__list--rewards', {
          'card--disabled': isNotEligible,
        })}
      >
        {rewards.map(reward => <RewardTile key={reward.reward_type} reward={reward} />)}
      </div>
    );

So then why I can claim rewards if I'm not elegible?, I think there is a header notice to let me know what's going on, on the same file the method: renderPageHeader has this conditional to render a message but if the criteria is not meet then it renders nothing(because there is no else, which is happening to me:

if (user && !user.is_reward_approved && daemonSettings.share_usage_data) { // true && false && true

so I've debugged my user and I see user.is_reward_approved returns true, and negated by ! its changes to false, how can I be approved and take the rewards if the property user.is_identity_verified is false. I don't know which conditional to change or what should be seing my user with the current properties, I've removed !user.is_identity_verified on the first part of this code and I don't see the layout greyed out anymore.

Contributor

dan1d commented May 15, 2018

Hi @tzarebczan

Currently I have an account that I can reproduce this bug, I see the rewards cards greyed out.
I've figured what's the issue but I'm not entirely sure what's the best approach to fix this:
on this file src/renderer/page/rewards/view.jsx


This code is the one that puts the gray layout on top of the rewards:
const isNotEligible =
      !user || !user.primary_email || !user.has_verified_email || !user.is_identity_verified; // I have all of them except is_identity_verified which is false so it returns true !, so I'm not elegible for rewards and that code add the class card--disabled.

    return (
      <div
        className={classnames('card__list--rewards', {
          'card--disabled': isNotEligible,
        })}
      >
        {rewards.map(reward => <RewardTile key={reward.reward_type} reward={reward} />)}
      </div>
    );

So then why I can claim rewards if I'm not elegible?, I think there is a header notice to let me know what's going on, on the same file the method: renderPageHeader has this conditional to render a message but if the criteria is not meet then it renders nothing(because there is no else, which is happening to me:

if (user && !user.is_reward_approved && daemonSettings.share_usage_data) { // true && false && true

so I've debugged my user and I see user.is_reward_approved returns true, and negated by ! its changes to false, how can I be approved and take the rewards if the property user.is_identity_verified is false. I don't know which conditional to change or what should be seing my user with the current properties, I've removed !user.is_identity_verified on the first part of this code and I don't see the layout greyed out anymore.

@tzarebczan

This comment has been minimized.

Show comment
Hide comment
@tzarebczan

tzarebczan May 15, 2018

Member

@dan1d great work on the debugging! I'm pretty sure we want to use user.is_reward_approved instead of is_identity_verified to check for rewards eligibility. is_identity verified only applies to the credit card verification method, but we also have phone verification, youtube, and manual overrides - all of which are encompassed under is_reward_approved.

Member

tzarebczan commented May 15, 2018

@dan1d great work on the debugging! I'm pretty sure we want to use user.is_reward_approved instead of is_identity_verified to check for rewards eligibility. is_identity verified only applies to the credit card verification method, but we also have phone verification, youtube, and manual overrides - all of which are encompassed under is_reward_approved.

@dan1d

This comment has been minimized.

Show comment
Hide comment
@dan1d

dan1d May 15, 2018

Contributor

@tzarebczan Thanks for the clarification, I need that kind of information so I can wrap my head around the entire stack, which seems really big, I've pushed my fix and was already merged 👍

Contributor

dan1d commented May 15, 2018

@tzarebczan Thanks for the clarification, I need that kind of information so I can wrap my head around the entire stack, which seems really big, I've pushed my fix and was already merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment