From 2590bdcc5409a4fede52321ed836da0935159a1a Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Wed, 13 Sep 2023 09:13:49 +0100 Subject: [PATCH] fix: console error --- src/libs/actions/IOU.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 37246fdf102c..d0f392638a88 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -999,12 +999,11 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC // STEP 3: Compute the IOU total and update the report preview message so LHN amount owed is correct // Should only update if the transaction matches the currency of the report, else we wait for the update // from the server with the currency conversion - let updatedMoneyRequestReport = null; + let updatedMoneyRequestReport = {...iouReport}; const updatedChatReport = {...chatReport}; if (updatedTransaction.currency === iouReport.currency && updatedTransaction.modifiedAmount) { const diff = TransactionUtils.getAmount(transaction, true) - TransactionUtils.getAmount(updatedTransaction, true); if (ReportUtils.isExpenseReport(iouReport)) { - updatedMoneyRequestReport = {...iouReport}; updatedMoneyRequestReport.total += diff; } else { updatedMoneyRequestReport = IOUUtils.updateIOUOwnerAndTotal(iouReport, updatedReportAction.actorAccountID, diff, TransactionUtils.getCurrency(transaction), false);