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

[CP Staging] fix wrong last message in LHN after message deletion #50110

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
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: 4 additions & 3 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ Onyx.connect({

const firstReportAction = sortedReportActions.at(0);
if (!firstReportAction) {
return;
delete lastReportActions[reportID];
} else {
lastReportActions[reportID] = firstReportAction;
}

lastReportActions[reportID] = firstReportAction;

// The report is only visible if it is the last action not deleted that
// does not match a closed or created state.
const reportActionsForDisplay = sortedReportActions.filter(
Expand All @@ -334,6 +334,7 @@ Onyx.connect({
);
const reportActionForDisplay = reportActionsForDisplay.at(0);
if (!reportActionForDisplay) {
delete lastVisibleReportActions[reportID];
return;
}
lastVisibleReportActions[reportID] = reportActionForDisplay;
Expand Down
1 change: 1 addition & 0 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Onyx.connect({

const reportAction = reportActionsForDisplay.at(-1);
if (!reportAction) {
delete visibleReportActionItems[reportID];
return;
}
visibleReportActionItems[reportID] = reportAction;
Expand Down
Loading