Skip to content

Commit

Permalink
Fix default value for inexistent reportID
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-solecki committed Jan 8, 2025
1 parent 12d4d7b commit 721e615
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const ROUTES = {
REPORT: 'r',
REPORT_WITH_ID: {
route: 'r/:reportID?/:reportActionID?',
getRoute: (reportID: string, reportActionID?: string, referrer?: string) => {
getRoute: (reportID: string | number, reportActionID?: string, referrer?: string) => {
const baseRoute = reportActionID ? (`r/${reportID}/${reportActionID}` as const) : (`r/${reportID}` as const);
const referrerParam = referrer ? `?referrer=${encodeURIComponent(referrer)}` : '';
return `${baseRoute}${referrerParam}` as const;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Navigation/dismissModalWithReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function dismissModalWithReport(targetReport: OnyxEntry<Report>, navigationRef:
case SCREENS.CONCIERGE:
// If we are not in the target report, we need to navigate to it after dismissing the modal
if (targetReport?.reportID !== getTopmostReportId(state)) {
const reportState = getStateFromPath(ROUTES.REPORT_WITH_ID.getRoute(targetReport?.reportID ?? `${CONST.DEFAULT_NUMBER_ID}`));
const reportState = getStateFromPath(ROUTES.REPORT_WITH_ID.getRoute(targetReport?.reportID ?? CONST.DEFAULT_NUMBER_ID));
const policyID = getPolicyIDFromState(state as State<RootStackParamList>);
const policyMemberAccountIDs = getPolicyEmployeeAccountIDs(policyID);
const shouldOpenAllWorkspace = isEmptyObject(targetReport) ? true : !doesReportBelongToWorkspace(targetReport, policyMemberAccountIDs, policyID);
Expand Down

0 comments on commit 721e615

Please sign in to comment.