Fix make default payment#8410
Conversation
| shouldShowDefaultDeleteMenu: false, | ||
| shouldShowPasswordPrompt: false, | ||
| shouldShowConfirmPopover: false, | ||
| isSelectedPaymentMethodDefault: true, |
There was a problem hiding this comment.
| isSelectedPaymentMethodDefault: true, | |
| isSelectedPaymentMethodDefault: false, |
| * @param {Boolean} accountDefault | ||
| */ | ||
| paymentMethodPressed(nativeEvent, accountType, account) { | ||
| paymentMethodPressed(nativeEvent, accountType, account, accountDefault) { |
There was a problem hiding this comment.
| paymentMethodPressed(nativeEvent, accountType, account, accountDefault) { | |
| paymentMethodPressed(nativeEvent, accountType, account, isDefault) { |
| }; | ||
| } | ||
| this.setState({ | ||
| isSelectedPaymentMethodDefault: !accountDefault, |
There was a problem hiding this comment.
Don't you think that variable does not justify the value it stores? Shouldn't it be storing the reversed value?
| isSelectedPaymentMethodDefault: !accountDefault, | |
| isSelectedPaymentMethodDefault: accountDefault, |
luacmartins
left a comment
There was a problem hiding this comment.
+1 to @parasharrajat's comments!
|
@luacmartins @parasharrajat I've updated. |
|
Testing it in an hour. |
luacmartins
left a comment
There was a problem hiding this comment.
Nice attention to detail @parasharrajat! Let's fix that extra margin @phivh!
|
@luacmartins @parasharrajat Spacing updated! |
|
|
||
| render() { | ||
| const isPayPalMeSelected = this.state.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PAYPAL; | ||
| const isShowButtonMakeDefaultPayment = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; |
There was a problem hiding this comment.
| const isShowButtonMakeDefaultPayment = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; | |
| const shouldShowMakeDefaultButton = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; |
There was a problem hiding this comment.
Updated name does not match with requested change.
|
|
||
| render() { | ||
| const isPayPalMeSelected = this.state.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PAYPAL; | ||
| const shouldShowButtonMakeDefaultPayment = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; |
There was a problem hiding this comment.
Small name change:
| const shouldShowButtonMakeDefaultPayment = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; | |
| const shouldShowMakeDefaultButton = !this.state.isSelectedPaymentMethodDefault && Permissions.canUseWallet(this.props.betas) && !isPayPalMeSelected; |
|
@luacmartins @parasharrajat Sorry, it should be good now. |
parasharrajat
left a comment
There was a problem hiding this comment.
LGTM
cc: @luacmartins
PR Reviewer Checklist
- I verified the PR has a small number of commits behind
main - I verified the correct issue is linked in the
### Fixed Issuessection above - I verified testing steps are clear and they cover the changes made in this PR
- I verified the testing environment is mentioned in the test steps
- I verified testing steps cover success & fail scenarios (if applicable)
- I checked that screenshots or videos are included for tests on all platforms
- I verified tests pass on all platforms & I tested again on:
- iOS / native
- Android / native
- iOS / Safari
- Android / Chrome
- MacOS / Chrome
- MacOS / Desktop
- I verified there are no console errors related to changes in this PR
- I verified proper code patterns were followed (see Reviewing the code)
- I verified comments were added when the code was not self explanatory
- I verified any copy / text shown in the product was added in all
src/languages/*files (if applicable) - I verified proper naming convention for platform-specific files was followed (if applicable)
- I verified style guidelines were followed
- I verified the JSDocs style guidelines (in
STYLE.md) were followed
- I verified that this PR follows the guidelines as stated in the Review Guidelines
- I verified other components are not impacted by changes in this PR (i.e. if the PR modifies a shared library or component like
Avatar, I verified the components usingAvatarare working as expected) - I verified the UI performance was not affected (the performance is the same than
mainbranch) - If a new component is created I verified that a similar component doesn't exist in the codebase
🎀 👀 🎀 C+ reviewed
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @luacmartins in version: 1.1.52-0 🚀
|
|
🚀 Deployed to production by @roryabraham in version: 1.1.52-0 🚀
|

Details
Fixed Issues
$ #8248
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
Screenshots
Web
web.mp4
Mobile Web
mWeb.mp4
Desktop
desktopapp.mp4
iOS
ios.mp4
Android
android.mp4