Skip to content

Commit

Permalink
refactor: change functions names
Browse files Browse the repository at this point in the history
  • Loading branch information
daledah committed Jan 31, 2025
1 parent e176bd6 commit 21c9f01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ function getTopMostCentralPaneRouteFromRootState() {
return getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>);
}

function getPreviousTrackReport(reportID?: string) {
function getReportRouteByID(reportID?: string) {
if (!reportID) {
return null;
}
return navigationRef.getRootState().routes.find((r) => r.name === SCREENS.REPORT && !!r.params && 'reportID' in r.params && r.params.reportID === reportID);
return navigationRef.getRootState().routes.find((route) => route.name === SCREENS.REPORT && !!route.params && 'reportID' in route.params && route.params.reportID === reportID);
}

function removeScreenFromNavigationState(screen: Screen) {
Expand Down Expand Up @@ -488,7 +488,7 @@ export default {
getTopMostCentralPaneRouteFromRootState,
removeScreenFromNavigationState,
removeScreenByKey,
getPreviousTrackReport,
getReportRouteByID,
};

export {navigationRef};
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4415,7 +4415,7 @@ function requestMoney(requestMoneyInformation: RequestMoneyInformation) {
InteractionManager.runAfterInteractions(() => removeDraftTransaction(CONST.IOU.OPTIMISTIC_TRANSACTION_ID));
Navigation.dismissModal(isSearchTopmostCentralPane() ? undefined : activeReportID);

const trackReport = Navigation.getPreviousTrackReport(linkedTrackedExpenseReportAction?.childReportID);
const trackReport = Navigation.getReportRouteByID(linkedTrackedExpenseReportAction?.childReportID);
if (trackReport?.key) {
Navigation.isNavigationReady().then(() => Navigation.removeScreenByKey(trackReport.key));
}
Expand Down

0 comments on commit 21c9f01

Please sign in to comment.