-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
} | ||
|
||
render() { | ||
if (_.isEmpty(this.props.userWallet)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: {}
Closing this PR in favor of another solution which I patched in the ONYX. #4604 |
Details
Fixed Issues
$ #4392
Tests | QA Steps
Tested On
Screenshots
Web
enable-payments.mp4
Mobile Web
Desktop
iOS
Android