-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Dismissing the error for corrupted PDF scan request does not delete the expense #43346
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: Native0-android.mp4Android: mWeb Chrome0-mobile-chrome.mp4iOS: Native0-ios.mp4iOS: mWeb Safari0-ios.mp4MacOS: Chrome / Safari0-web.mp4MacOS: Desktop0-desktop.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested well. Just comments about Default value for inexistent IDs
@nkdengineer Gentle bump in case you missed this one. Please take a look at comments^ |
@eh2077 i'll update today |
Co-authored-by: Eric Han <117511920+eh2077@users.noreply.github.com>
Co-authored-by: Eric Han <117511920+eh2077@users.noreply.github.com>
const deleteTransaction = useCallback(() => { | ||
if (!parentReportAction) { | ||
return; | ||
} | ||
const iouTransactionID = parentReportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? parentReportAction.originalMessage?.IOUTransactionID ?? '-1' : '-1'; | ||
if (ReportActionsUtils.isTrackExpenseAction(parentReportAction)) { | ||
IOU.deleteTrackExpense(parentReport?.reportID ?? '-1', iouTransactionID, parentReportAction, true); | ||
return; | ||
} | ||
IOU.deleteMoneyRequest(iouTransactionID, parentReportAction, true); | ||
}, [parentReport?.reportID, parentReportAction]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no point in using useCallback
here since you are not passing down this function to another component and you are not using it in another function wrapped in useCallback
.
Can you instead define this function outside of the component and receive as parameters parentReport
and parentReportAction
🙏 ?
Then later you call it with deleteTransaction(parentReport, parentReportAction)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aldo-expensify please check again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing the changes @nkdengineer 🙇
✋ 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/aldo-expensify in version: 9.0.1-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.1-19 🚀
|
Details
Fixed Issues
$ #42120
PROPOSAL: #42120 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
desktop.mov
MacOS: Desktop
web.mov