Fix download doesn't show in invoice report#58941
Conversation
|
@ahmedGaber93 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] |
Reviewer Checklist
Screenshots/VideosAndroid: Nativea.mp4Android: mWeb Chromeaw.mp4iOS: NativeFailed to run the app due to issue on the main branch, the other platforms videos should be enough. iOS: mWeb Safariiw.mp4MacOS: Chrome / Safariw.mp4MacOS: Desktopd.mp4 |
| } | ||
| // 1. HeaderView | ||
| return CASES.DEFAULT; | ||
| }, [isInvoiceReport, isMoneyRequestReport, isSingleTransactionView]); |
There was a problem hiding this comment.
Can we remove useMemo and just use if else here? Memoization shouldn't be necessary.
There was a problem hiding this comment.
Why it isn't necessary? Btw, this is an existing code, I just moved it higher.
(it's much cleaner compared to using if else or nested ternary which lint will complaint about)
There was a problem hiding this comment.
It's not necessary because this code only checks 3 booleans which is very fast. useMemo optimizes slow code by saving and using the old value if the dependencies don't change. In this case, checking the dependency array is actually slower and uses more memory than just running the code itself.
I know you didn't write it, but let's clean it up anyway. We should be able to just write this with if ... else if ... else without any errors.
arosiclair
left a comment
There was a problem hiding this comment.
Thanks for the changes
|
✋ 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/arosiclair in version: 9.1.19-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.1.19-5 🚀
|
Explanation of Change
Fixed Issues
$ #58346
PROPOSAL: #58346 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Precondition:
Invoice feature is enabled.
PR 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.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4