From 23d70ae1b54a1b87690b0e6ac0fff7cf178525ae Mon Sep 17 00:00:00 2001 From: Andrew Li Date: Fri, 29 Sep 2023 13:22:37 +0800 Subject: [PATCH 1/2] Don't reset lastVisibleActionCreated optimistically in case the comment is the last one --- src/libs/actions/Report.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 66008ae5ae2a..82f1c086f488 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1031,7 +1031,6 @@ function deleteReportComment(reportID, reportAction) { let optimisticReport = { lastMessageTranslationKey: '', lastMessageText: '', - lastVisibleActionCreated: '', }; if (reportAction.childVisibleActionCount === 0) { optimisticReport = { From 5b9c5649f8d293b68abcb617121c30a43d7102a4 Mon Sep 17 00:00:00 2001 From: Andrew Li Date: Thu, 12 Oct 2023 22:31:34 -0400 Subject: [PATCH 2/2] Update comment --- src/libs/actions/Report.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 110e79358b9e..8f641d918c46 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1040,7 +1040,8 @@ function deleteReportComment(reportID, reportAction) { }; // If we are deleting the last visible message, let's find the previous visible one (or set an empty one if there are none) and update the lastMessageText in the LHN. - // Similarly, if we are deleting the last read comment we will want to update the lastVisibleActionCreated to use the previous visible message. + // Similarly, if we are deleting the last read comment we will want to update the lastVisibleActionCreated to use the previous visible message. If there is no + // previous comment, we don't reset lastVisibleActionCreated since we want the report to keep its position in the LHN. let optimisticReport = { lastMessageTranslationKey: '', lastMessageText: '',