Skip to content

Commit faae274

Browse files
BeamanatorOSBotify
authored andcommitted
Merge pull request #50110 from situchan/fix-50069
[CP Staging] fix wrong last message in LHN after message deletion (cherry picked from commit 312fdec) (CP triggered by Beamanator)
1 parent f9c3a41 commit faae274

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libs/OptionsListUtils.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ Onyx.connect({
317317

318318
const firstReportAction = sortedReportActions.at(0);
319319
if (!firstReportAction) {
320-
return;
320+
delete lastReportActions[reportID];
321+
} else {
322+
lastReportActions[reportID] = firstReportAction;
321323
}
322324

323-
lastReportActions[reportID] = firstReportAction;
324-
325325
// The report is only visible if it is the last action not deleted that
326326
// does not match a closed or created state.
327327
const reportActionsForDisplay = sortedReportActions.filter(
@@ -334,6 +334,7 @@ Onyx.connect({
334334
);
335335
const reportActionForDisplay = reportActionsForDisplay.at(0);
336336
if (!reportActionForDisplay) {
337+
delete lastVisibleReportActions[reportID];
337338
return;
338339
}
339340
lastVisibleReportActions[reportID] = reportActionForDisplay;

src/libs/SidebarUtils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Onyx.connect({
5151

5252
const reportAction = reportActionsForDisplay.at(-1);
5353
if (!reportAction) {
54+
delete visibleReportActionItems[reportID];
5455
return;
5556
}
5657
visibleReportActionItems[reportID] = reportAction;

0 commit comments

Comments
 (0)