Fix/75366 - After deleting IOU, nothing to show is shown briefly before updating to default page - #76718
Conversation
…ating to default page
…ating to default page
|
@marcochavezf 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-05.at.4.19.02.PM.movAndroid: mWeb ChromeScreen.Recording.2025-12-05.at.4.18.01.PM.moviOS: HybridAppScreen.Recording.2025-12-05.at.4.24.07.PM.moviOS: mWeb SafariScreen.Recording.2025-12-05.at.4.19.20.PM.movMacOS: Chrome / SafariScreen.Recording.2025-12-05.at.3.46.17.PM.mov |
| const hasExpenseReportsSelector = (reports: OnyxCollection<Report>) => | ||
| Object.values(reports ?? {}).filter((report) => report?.type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT && report?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length > | ||
| 0; | ||
| Object.values(reports ?? {}).filter((report) => report?.type === CONST.REPORT.TYPE.EXPENSE && report?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE).length > 0; |
There was a problem hiding this comment.
Why need to change this? It doesn't seem right to me, shouldn't check EXPENSE_REPORT here as the method name suggest?
There was a problem hiding this comment.
When I saw the check report?.type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT, I was quite confused, so I reviewed all instances of report?.type both in the actual data and in the type definitions. After checking, I believe that using CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT here was a mistake, so I have corrected it.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Product changes look good to me
|
✋ 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/marcochavezf in version: 9.2.74-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
Explanation of Change
On the reports page, when a user deletes all expenses, the message "Nothing to show" is briefly displayed before it updates to "You haven't created any expenses yet". This issue occurs because we rely on the hasResults value returned from the backend, which is not updated immediately after deleting all expenses. This PR ensures that the correct message "You haven't created any expenses yet" is displayed right away when all expenses are deleted.
Fixed Issues
$ #75366
PROPOSAL: #75366 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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.mweb.mp4
Android: mWeb Chrome
android.native.mp4
iOS: Native
ios.native.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
mac.safari.mp4