Fix amount reset#32884
Conversation
|
@0xmiroslav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Just to confirm, is this the expected behaviour now because it differs from the current production behaviour? |
Seems so based on discussion |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb ChromeiOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
0xmiroslav
left a comment
There was a problem hiding this comment.
When switch tab:
production: currency not cleared, amount not cleared
staging: currency cleared, amount not cleared
this branch: currency cleared, amount cleared
|
@joelbettner Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Yes, that's the new behavior. Both should be cleared when switching tabs. |
|
@Julesssss we need to CP this PR |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
CP in progress |
(cherry picked from commit 4239252)
|
🚀 Cherry-picked to staging by https://github.com/Julesssss in version: 1.4.11-9 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.11-25 🚀
|
| // we want to re-initialize the state only when the selected tab changes | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [amount]); | ||
| }, [selectedTab]); |
There was a problem hiding this comment.
We discussed this internally and thought it made sense to only initialize the amount when the tab changes since that's the intended behavior. It seems like the code was coupled elsewhere though which caused the regressions above.
There was a problem hiding this comment.
ok, so it's fine to add this back? I don't find any side effect after this.
}, [amount, selectedTab]);
There was a problem hiding this comment.
Yea, I think it's ok as long as the amount still resets when the tab is switched
Details
Discussed here. Resets state when user switches tabs
Fixed Issues
$ #32838
Tests
+ > Request money > ManualOffline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
web.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop