From 9cf64c0cc0ee8e71d5728ab5b2c9178e52532c75 Mon Sep 17 00:00:00 2001 From: Jakub Trzebiatowski Date: Mon, 13 Nov 2023 09:33:47 +0100 Subject: [PATCH] ReportUtils.js: Add a clarifying comment ...in the context of the discussion in the issue #30796 --- src/libs/ReportUtils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 9f8e138afccd..a18594905b55 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -4090,6 +4090,10 @@ function getIOUReportActionDisplayMessage(reportAction) { let translationKey; if (originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY) { const {IOUReportID} = originalMessage; + + // The `REPORT_ACTION_TYPE.PAY` action type is used for both fulfilling existing requests and sending money. To + // differentiate between these two scenarios, we check if the `originalMessage` contains the `IOUDetails` + // property. If it does, it indicates that this is a 'Send money' action. const {amount, currency} = originalMessage.IOUDetails || originalMessage; const formattedAmount = CurrencyUtils.convertToDisplayString(amount, currency); const iouReport = getReport(IOUReportID);