From 3381112040635662a2acdeff757fc78f82c099a1 Mon Sep 17 00:00:00 2001 From: daledah Date: Wed, 7 Aug 2024 22:00:52 +0700 Subject: [PATCH] fix: add Parser.htmlToText --- src/libs/SidebarUtils.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index bc054311e93f..abbbee63ac15 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -420,13 +420,13 @@ function getOptionData({ } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.LEAVE_POLICY) { result.alternateText = Localize.translateLocal('workspace.invite.leftWorkspace'); } else if (lastAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && lastActorDisplayName && lastMessageTextFromReport) { - result.alternateText = ReportUtils.formatReportLastMessageText(`${lastActorDisplayName}: ${lastMessageText}`); + result.alternateText = ReportUtils.formatReportLastMessageText(Parser.htmlToText(`${lastActorDisplayName}: ${lastMessageText}`)); } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAG) { result.alternateText = PolicyUtils.getCleanedTagName(ReportActionsUtils.getReportActionMessage(lastAction)?.text ?? ''); } else { result.alternateText = lastMessageTextFromReport.length > 0 - ? ReportUtils.formatReportLastMessageText(lastMessageText) + ? ReportUtils.formatReportLastMessageText(Parser.htmlToText(lastMessageText)) : ReportActionsUtils.getLastVisibleMessage(report.reportID, {}, lastAction)?.lastMessageText; if (!result.alternateText) { result.alternateText = ReportUtils.formatReportLastMessageText(getWelcomeMessage(report, policy).messageText ?? Localize.translateLocal('report.noActivityYet')); @@ -436,11 +436,10 @@ function getOptionData({ if (!lastMessageText) { lastMessageText = ReportUtils.formatReportLastMessageText(getWelcomeMessage(report, policy).messageText ?? Localize.translateLocal('report.noActivityYet')); } - result.alternateText = (ReportUtils.isGroupChat(report) || ReportUtils.isDeprecatedGroupDM(report)) && lastActorDisplayName - ? ReportUtils.formatReportLastMessageText(`${lastActorDisplayName}: ${lastMessageText}`) - : ReportUtils.formatReportLastMessageText(lastMessageText) || formattedLogin; + ? ReportUtils.formatReportLastMessageText(Parser.htmlToText(`${lastActorDisplayName}: ${lastMessageText}`)) + : ReportUtils.formatReportLastMessageText(Parser.htmlToText(lastMessageText)) || formattedLogin; } result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result as Report);