From 48abfaf602017e42aea312f3ed39810895923862 Mon Sep 17 00:00:00 2001 From: neil-marcellini Date: Wed, 26 Jun 2024 09:50:08 -0700 Subject: [PATCH] Show optimistic distance receipt for tracked expenses --- src/libs/actions/IOU.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 6a9427e884ec..0ffd0f53975d 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -3623,6 +3623,9 @@ function trackExpense( const moneyRequestReportID = isMoneyRequestReport ? report.reportID : ''; const isMovingTransactionFromTrackExpense = IOUUtils.isMovingTransactionFromTrackExpense(action); + // Pass an open receipt so the distance expense will show a map with the route optimistically + const trackedReceipt = validWaypoints ? {source: ReceiptGeneric as ReceiptSource, state: CONST.IOU.RECEIPT_STATE.OPEN} : receipt; + const { createdWorkspaceParams, iouReport, @@ -3645,7 +3648,7 @@ function trackExpense( currency, created, merchant, - receipt, + trackedReceipt, category, tag, taxCode,