Skip to content
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

fix loader on the enablePayments page #4468

Closed
wants to merge 1 commit into from

Conversation

parasharrajat
Copy link
Member

@parasharrajat parasharrajat commented Aug 6, 2021

Details

Fixed Issues

$ #4392

Tests | QA Steps

  1. Navigate to staging.new.expensify.com/enable-payments.
  2. Refresh the page

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

enable-payments.mp4

Mobile Web

Desktop

iOS

Android

@parasharrajat parasharrajat requested a review from a team as a code owner August 6, 2021 20:26
@MelvinBot MelvinBot requested review from AndrewGable and removed request for a team August 6, 2021 20:26
}

render() {
if (_.isEmpty(this.props.userWallet)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not check for this anymore?

Copy link
Member Author

@parasharrajat parasharrajat Aug 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are using the state variable loading now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but will we show this component when the prop userWallet is not empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is an issue with this component which I have shared on slack.
this component will not update if userWallet data never changes which will be the case most of the time.
This issue is coming from Onyx changes. I am going to raise this issue now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. I think if a user has a wallet and they go to /enable-payments - I think we should not go into this if block, but maybe I am mistaken?

Copy link
Member Author

@parasharrajat parasharrajat Aug 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the Approach here is that We don't use the stored userWallet data and always request new.

  userWallet: {
        key: ONYXKEYS.USER_WALLET,

        // We want to refresh the wallet each time the user attempts to activate the wallet so we won't use the
        // We want to refresh the wallet each time the user attempts to activate the wallet so we won't use the
        // stored values here.

        initWithStoredValues: false,
    },

So there is always going to be API request and we start with empty defaultProps

userWallet: {}

@parasharrajat
Copy link
Member Author

parasharrajat commented Aug 12, 2021

Closing this PR in favor of another solution which I patched in the ONYX. #4604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants