From 52a5f2e5cff464ba3b67910b9b6bf4b8911fd37b Mon Sep 17 00:00:00 2001 From: dominictb Date: Mon, 12 Aug 2024 15:26:32 +0700 Subject: [PATCH] fix: update transaction filename in getTrackExpenseInformation --- src/libs/actions/IOU.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index ef5f6d6d61c0..9dcfba4a6c12 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -2291,6 +2291,9 @@ function getTrackExpenseInformation( filename = receipt.name; } const existingTransaction = allTransactionDrafts[`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${existingTransactionID ?? CONST.IOU.OPTIMISTIC_TRANSACTION_ID}`]; + if (!filename) { + filename = existingTransaction?.filename; + } const isDistanceRequest = existingTransaction && existingTransaction.iouRequestType === CONST.IOU.REQUEST_TYPE.DISTANCE; let optimisticTransaction = TransactionUtils.buildOptimisticTransaction( ReportUtils.isExpenseReport(iouReport) ? -amount : amount,