Skip to content

Commit

Permalink
Remove extra encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
pecanoro committed Mar 16, 2023
1 parent 646ed3d commit aa2e559
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@ function buildOptimisticIOUReport(ownerEmail, userEmail, total, chatReportID, cu
function getIOUReportActionMessage(type, total, participants, comment, currency, paymentType = '', isSettlingUp = false) {
const amount = NumberFormatUtils.format(preferredLocale, total / 100, {style: 'currency', currency});
const displayNames = _.map(participants, participant => getDisplayNameForParticipant(participant.login, true));
const commentText = getParsedComment(comment);
const who = displayNames.length < 3
? displayNames.join(' and ')
: `${displayNames.slice(0, -1).join(', ')}, and ${_.last(displayNames)}`;
Expand All @@ -979,28 +978,28 @@ function getIOUReportActionMessage(type, total, participants, comment, currency,
let iouMessage;
switch (type) {
case CONST.IOU.REPORT_ACTION_TYPE.CREATE:
iouMessage = `Requested ${amount} from ${who}${commentText && ` for ${commentText}`}`;
iouMessage = `Requested ${amount} from ${who}${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.SPLIT:
iouMessage = `Split ${amount} with ${who}${commentText && ` for ${commentText}`}`;
iouMessage = `Split ${amount} with ${who}${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.CANCEL:
iouMessage = `Cancelled the ${amount} request${commentText && ` for ${commentText}`}`;
iouMessage = `Cancelled the ${amount} request${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.DECLINE:
iouMessage = `Declined the ${amount} request${commentText && ` for ${commentText}`}`;
iouMessage = `Declined the ${amount} request${comment && ` for ${comment}`}`;
break;
case CONST.IOU.REPORT_ACTION_TYPE.PAY:
iouMessage = isSettlingUp
? `Settled up${paymentMethodMessage}`
: `Sent ${amount}${commentText && ` for ${commentText}`}${paymentMethodMessage}`;
: `Sent ${amount}${comment && ` for ${comment}`}${paymentMethodMessage}`;
break;
default:
break;
}

return [{
html: iouMessage,
html: getParsedComment(iouMessage),
text: iouMessage,
isEdited: false,
type: CONST.REPORT.MESSAGE.TYPE.COMMENT,
Expand Down

0 comments on commit aa2e559

Please sign in to comment.