From 98298a4d89af5566b126692ca687688f92c76135 Mon Sep 17 00:00:00 2001 From: Dmytro Klymenko Date: Wed, 24 Nov 2021 19:17:11 +0300 Subject: [PATCH] refactor the fix to save a few lines --- src/libs/actions/Report.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d4991a27df7c..9d321c39ac22 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -170,7 +170,7 @@ function getSimplifiedReportObject(report) { const isLastMessageAttachment = /]+)\/>/gi.test(lastActionMessage); const chatType = lodashGet(report, ['reportNameValuePairs', 'chatType'], ''); - let lastMessageText; + let lastMessageText = null; if (report.reportActionCount > 0) { // We are removing any html tags from the message html since we cannot access the text version of any comments as // the report only has the raw reportActionList and not the processed version returned by Report_GetHistory @@ -178,8 +178,6 @@ function getSimplifiedReportObject(report) { lastMessageText = lastActionMessage .replace(/((]*>)+)/gi, ' ') .replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`; - } else { - lastMessageText = null; } const reportName = lodashGet(report, ['reportNameValuePairs', 'type']) === 'chat' ? getChatReportName(report, chatType)