-
Notifications
You must be signed in to change notification settings - Fork 3k
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: back button returns to expense report after submitting track expense #53065
base: main
Are you sure you want to change the base?
Changes from all commits
24fcb4a
9a9ed9a
430609a
e67221c
14f77f9
9b5e599
5e1b5d4
1f8b4c6
89dceb3
e176bd6
21c9f01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4414,6 +4414,12 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation) { | |
|
||
InteractionManager.runAfterInteractions(() => removeDraftTransaction(CONST.IOU.OPTIMISTIC_TRANSACTION_ID)); | ||
Navigation.dismissModal(isSearchTopmostCentralPane() ? undefined : activeReportID); | ||
|
||
const trackReport = Navigation.getReportRouteByID(linkedTrackedExpenseReportAction?.childReportID); | ||
if (trackReport?.key) { | ||
Navigation.isNavigationReady().then(() => Navigation.removeScreenByKey(trackReport.key)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're calling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the call Screen.Recording.2025-01-07.at.23.37.22.movThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eVoloshchak I just updated the function logics, we don't need to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR I implemented the same logic without |
||
} | ||
|
||
if (activeReportID) { | ||
notifyNewAction(activeReportID, payeeAccountID); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,8 +77,19 @@ jest.mock('@src/libs/Navigation/Navigation', () => ({ | |
goBack: jest.fn(), | ||
getTopmostReportId: jest.fn(() => topMostReportID), | ||
setNavigationActionToMicrotaskQueue: jest.fn(), | ||
removeScreenByKey: jest.fn(), | ||
isNavigationReady: jest.fn(() => Promise.resolve()), | ||
getPreviousTrackReport: jest.fn(), | ||
})); | ||
|
||
jest.mock('@src/libs/Navigation/navigationRef', () => ({ | ||
getRootState: () => ({ | ||
routes: [], | ||
}), | ||
})); | ||
|
||
jest.mock('@react-navigation/native'); | ||
|
||
jest.mock('@src/libs/actions/Report', () => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const originalModule = jest.requireActual('@src/libs/actions/Report'); | ||
|
@@ -88,6 +99,7 @@ jest.mock('@src/libs/actions/Report', () => { | |
notifyNewAction: jest.fn(), | ||
}; | ||
}); | ||
|
||
jest.mock('@src/libs/Navigation/isSearchTopmostCentralPane', () => jest.fn()); | ||
|
||
const CARLOS_EMAIL = '[email protected]'; | ||
|
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.