Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ function IOURequestStepConfirmation({
return;
}
if (isTimeRequest) {
if (isMovingTransactionFromTrackExpense) {
return Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_PARTICIPANTS.getRoute(iouType, initialTransactionID, transaction?.reportID ?? reportID, undefined, action), {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fall back when reportID is unreported

When submitting a tracked time expense that skips the participants step (e.g. preferred-policy auto‑assignment), the draft transaction can still have reportID set to UNREPORTED_REPORT_ID ('0'), because the auto‑assignment path only sets participants. With transaction?.reportID ?? reportID, the back button will pop to a participants route built with reportID 0 instead of the confirmation route’s reportID, which resets the selected workspace/participants and shows the wrong report. Consider explicitly falling back when the transaction reportID is unreported (or just use the route reportID).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhawryluk I think the problem is caused by this block: if (isTimeRequest). Why do we need it? It could also cause the same issue in the future when creating time expenses via global create

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I removed this block and updated the navigateToStartMoneyRequestStep function to support time and it works perfectly for when creating a request. however when submitting an expense from report details RHP, when we refresh the page and then click the back button the RHP is dismissed instead of navigating back to the participant page. but I think that's how it works for every other request type, so it's probably okay, right?

compareParams: false,
});
}
return Navigation.goBack(ROUTES.MONEY_REQUEST_CREATE_TAB_TIME.getRoute(action, iouType, initialTransactionID, reportID));
}

Expand Down
Loading