Skip to content

Commit

Permalink
Fix Issue-9539
Browse files Browse the repository at this point in the history
  • Loading branch information
JosueEchandiaAsto committed Jun 24, 2022
1 parent b38693e commit 1761614
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,13 @@ function updateReportWithNewAction(
reportAction,
notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
) {
const isAttachment = ReportUtils.isReportMessageAttachment(lodashGet(reportAction, ['message', 0], {}));
const messageHtml = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED
? lodashGet(reportAction, 'originalMessage.html', '')
: lodashGet(reportAction, ['message', 0, 'html'], '');

const parser = new ExpensiMark();
const messageText = parser.htmlToText(messageHtml);
const messageText = isAttachment ? `[${Localize.translateLocal('common.attachment')}]` : parser.htmlToText(messageHtml);

const updatedReportObject = {
// Always merge the reportID into Onyx. If the report doesn't exist in Onyx yet, then all the rest of the data will be filled out by handleReportChanged
Expand All @@ -575,7 +576,7 @@ function updateReportWithNewAction(
// Add the action into Onyx
reportActionsToMerge[reportAction.sequenceNumber] = {
...reportAction,
isAttachment: ReportUtils.isReportMessageAttachment(lodashGet(reportAction, ['message', 0], {})),
isAttachment,
loading: false,
};

Expand Down

0 comments on commit 1761614

Please sign in to comment.