Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/17212: Also update html message and get last message in LHN when edit offline #17586

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -924,11 +924,10 @@ function editReportComment(reportID, originalReportAction, textForNewComment) {

const lastVisibleAction = ReportActionsUtils.getLastVisibleAction(reportID, optimisticReportActions);
if (reportActionID === lastVisibleAction.reportActionID) {
const reportComment = parser.htmlToText(htmlForNewComment);
const lastMessageText = ReportUtils.formatReportLastMessageText(reportComment);
const optimisticReport = {
lastMessageHtml: lodashGet(lastVisibleAction, 'message[0].html'),
lastMessageText: lodashGet(lastVisibleAction, 'message[0].text'),
lastVisibleActionCreated: lastVisibleAction.created,
lastActorEmail: lastVisibleAction.actorEmail,
lastMessageText: Str.htmlDecode(lastMessageText),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need Str.htmlDecode() here if we already use htmlToTextabove?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nevermind got it, it's to decode sequences like &lt; to <, etc.

};
optimisticData.push({
onyxMethod: CONST.ONYX.METHOD.MERGE,
Expand Down