diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 314d7a6740a1..4ab84faad6e4 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -158,10 +158,7 @@ function getLastVisibleMessageText(reportID, actionsToMerge = {}) { const htmlText = lodashGet(lastVisibleAction, 'message[0].html', ''); const parser = new ExpensiMark(); const messageText = parser.htmlToText(htmlText); - return String(messageText) - .replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, '') - .substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH) - .trim(); + return String(messageText).replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, '').substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH).trim(); } /** diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 649627f2b1bd..dc295460175b 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -530,10 +530,7 @@ function canShowReportRecipientLocalTime(personalDetails, report) { * @returns {String} */ function formatReportLastMessageText(lastMessageText) { - return Str.htmlDecode(String(lastMessageText)) - .replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, '') - .substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH) - .trim(); + return Str.htmlDecode(String(lastMessageText)).replace(CONST.REGEX.AFTER_FIRST_LINE_BREAK, '').substring(0, CONST.REPORT.LAST_MESSAGE_TEXT_MAX_LENGTH).trim(); } /**