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: Not update edited message on LHN in offline mode #17324

Merged
Changes from 2 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
15 changes: 15 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,21 @@ function editReportComment(reportID, originalReportAction, textForNewComment) {
},
];

const lastVisibleAction = ReportActionsUtils.getLastVisibleAction(reportID, optimisticReportActions);
if (reportActionID === lastVisibleAction.reportActionID) {
const optimisticReport = {
lastMessageHTML: lodashGet(lastVisibleAction, 'message[0].html'),
dukenv0307 marked this conversation as resolved.
Show resolved Hide resolved
lastMessageText: lodashGet(lastVisibleAction, 'message[0].text'),
lastVisibleActionCreated: lastVisibleAction.created,
lastActorEmail: lastVisibleAction.actorEmail,
};
optimisticData.push({
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: optimisticReport,
});
}

const failureData = [
{
onyxMethod: CONST.ONYX.METHOD.MERGE,
Expand Down