Skip to content

Commit

Permalink
fix: add Parser.htmlToText
Browse files Browse the repository at this point in the history
  • Loading branch information
daledah committed Aug 7, 2024
1 parent 63893fe commit 3381112
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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);
Expand Down

0 comments on commit 3381112

Please sign in to comment.