Skip to content

Commit

Permalink
fix: console error
Browse files Browse the repository at this point in the history
  • Loading branch information
BeeMargarida committed Sep 13, 2023
1 parent 529180d commit 2590bdc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2590bdc

Please sign in to comment.