Repository navigation
Fix: Zero amount not displayed in receipt and expense details for distance expense - #58649
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
I'm just wondering, as per some comments in the thread if the |
|
If we don't have the amount I think we should display as empty. |
|
The PR has been updated to cover that case |
| const hasRoute = hasRouteTransactionUtils(transactionBackup ?? transaction, isDistanceRequest); | ||
| const pendingTransactionAmount = transaction?.pendingAction && isDistanceRequest && !hasRoute ? undefined : transactionAmount; | ||
| const formattedTransactionAmount = | ||
| pendingTransactionAmount !== null && pendingTransactionAmount !== undefined ? convertToDisplayString(pendingTransactionAmount, transactionCurrency) : ''; |
There was a problem hiding this comment.
Could we define pendingTransactionAmount !== null && pendingTransactionAmount !== undefined in a seperate const to avoid repeating ourselves? Thanks
There was a problem hiding this comment.
Sure, I've updated the code to separate the pending amount check into a new const
Reviewer Checklist
Screenshots/VideosAndroid: Native01_Android_Native.mp4Android: mWeb Chrome02_Android_Chrome.mp4iOS: Native03_iOS_Native.mp4iOS: mWeb Safari04_iOS_Safari.mp4MacOS: Chrome / Safari05_MacOS_Chrome.mp4MacOS: Desktop06_MacOS_Desktop.mp4 |
|
@ryntgh Something I just noticed is that the amount doesn't show up if we change it while the request is pending: Screen.Recording.2025-03-20.at.17.15.51.mov |
Ah yeah, you're right! I've updated the code to cover that edge case. Could you please check it again? Thanks |
|
@ryntgh I will review now, but do you mind merging main? I think some lint issues are fixed |
|
Sure, I've merged latest main |
|
✋ 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 https://github.com/rlinoz in version: 9.1.18-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.1.18-4 🚀
|




Explanation of Change
Fixed Issues
$ #58478
PROPOSAL: #58478 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
65, Pappammal Koil, Vaithikuppam, Puducherry, India & 67, Pappammal Koil, Vaithikuppam, Puducherry, India.
MoneyRequestViewis 0.00PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.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)Designlabel and/or tagged@Expensify/designso the design team can review the changes.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
Android: Native
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4