Skip to content

Commit eb4e8a5

Browse files
committed
restore temporary fix for multi-files dnd
1 parent 8767b08 commit eb4e8a5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/pages/iou/request/step/IOURequestStepConfirmation.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,15 @@ function IOURequestStepConfirmation({
322322
if (transaction?.isFromGlobalCreate && !transaction.receipt?.isTestReceipt) {
323323
// If the participants weren't automatically added to the transaction, then we should go back to the IOURequestStepParticipants.
324324
if (!transaction?.participantsAutoAssigned && participantsAutoAssignedFromRoute !== 'true') {
325-
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
326-
Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_PARTICIPANTS.getRoute(iouType, initialTransactionID, transaction?.reportID || reportID, undefined, action), {
325+
// TODO: temporary fix for multi-files dnd; check if other flow can use reportID instead of transaction?.reportID
326+
const shouldUseNewScanFlow = iouType === CONST.IOU.TYPE.TRACK || iouType === CONST.IOU.TYPE.SUBMIT;
327+
const backToReportID =
328+
shouldUseNewScanFlow && !transaction?.participants?.at(0)?.isPolicyExpenseChat
329+
? reportID
330+
: // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
331+
transaction?.reportID || reportID;
332+
const iouTypeForRoute = shouldUseNewScanFlow ? CONST.IOU.TYPE.CREATE : iouType;
333+
Navigation.goBack(ROUTES.MONEY_REQUEST_STEP_PARTICIPANTS.getRoute(iouTypeForRoute, initialTransactionID, backToReportID, undefined, action), {
327334
compareParams: false,
328335
});
329336
return;

0 commit comments

Comments
 (0)