Skip to content

Commit

Permalink
Merge pull request #40420 from FitseTLT/remove-backend-logs-in-getIOU…
Browse files Browse the repository at this point in the history
…ReportActionDisplayMessage

removed server logging code for getIOUReportActionDisplayMessage
  • Loading branch information
tgolen authored Apr 18, 2024
2 parents d1f1c48 + 57aa026 commit a96cc01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import isReportMessageAttachment from './isReportMessageAttachment';
import localeCompare from './LocaleCompare';
import * as LocalePhoneNumber from './LocalePhoneNumber';
import * as Localize from './Localize';
import Log from './Log';
import {isEmailPublicDomain} from './LoginUtils';
import ModifiedExpenseMessage from './ModifiedExpenseMessage';
import linkingConfig from './Navigation/linkingConfig';
Expand Down Expand Up @@ -5459,7 +5458,7 @@ function getTaskAssigneeChatOnyxData(
/**
* Return iou report action display message
*/
function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>, transaction?: OnyxEntry<Transaction>, shouldLog = false): string {
function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>, transaction?: OnyxEntry<Transaction>): string {
if (reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.IOU) {
return '';
}
Expand Down Expand Up @@ -5489,15 +5488,6 @@ function getIOUReportActionDisplayMessage(reportAction: OnyxEntry<ReportAction>,
return Localize.translateLocal(translationKey, {amount: formattedAmount, payer: ''});
}

// This log to server is temporary and needed to determine if there is a case we need the transaction param
// when we call getIOUReportActionDisplayMessage from ReportActionItemMessage
if (shouldLog) {
Log.alert('Transaction Param Used when getIOUReportActionDisplayMessage was called from ReportActionItemMessage', {
reportActionID: reportAction.reportActionID,
originalMessageType: originalMessage.type,
});
}

const transactionDetails = getTransactionDetails(!isEmptyObject(transaction) ? transaction : null);
const formattedAmount = CurrencyUtils.convertToDisplayString(transactionDetails?.amount ?? 0, transactionDetails?.currency);
const isRequestSettled = isSettled(originalMessage.IOUReportID);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function ReportActionItemMessage({action, transaction, displayAsGroup, reportID,
const originalMessage = action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU ? action.originalMessage : null;
const iouReportID = originalMessage?.IOUReportID;
if (iouReportID) {
iouMessage = ReportUtils.getIOUReportActionDisplayMessage(action, transaction, true);
iouMessage = ReportUtils.getIOUReportActionDisplayMessage(action, transaction);
}
}

Expand Down

0 comments on commit a96cc01

Please sign in to comment.