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

Keep report in same place in LHN after deleting last comment #28431

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,11 +1040,11 @@ 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: '',
lastVisibleActionCreated: '',
Li357 marked this conversation as resolved.
Show resolved Hide resolved
};
if (reportAction.childVisibleActionCount === 0) {
optimisticReport = {
Expand Down