Skip to content

Commit

Permalink
Merge pull request #22342 from rojiphil/19913-corrupt-att-upload
Browse files Browse the repository at this point in the history
Reset last visible message on failure of attachment upload
  • Loading branch information
techievivek authored Jul 10, 2023
2 parents ab37414 + 17a3436 commit 2e3f8c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ function addActions(reportID, text = '', file) {

const currentTime = DateUtils.getDBTime();

const prevVisibleMessageText = ReportActionsUtils.getLastVisibleMessageText(reportID);
const lastCommentText = ReportUtils.formatReportLastMessageText(lastAction.message[0].text);

const optimisticReport = {
Expand Down Expand Up @@ -294,7 +295,15 @@ function addActions(reportID, text = '', file) {
},
];

const failureReport = {
lastMessageText: prevVisibleMessageText,
};
const failureData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: failureReport,
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
Expand Down

0 comments on commit 2e3f8c2

Please sign in to comment.