Skip to content

Commit 9281342

Browse files
authored
Merge pull request #30485 from s-alves10/fix/issue-30359
fix: set null to unread marker when there are no new messages
2 parents 74f12d4 + 50f22be commit 9281342

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pages/home/report/ReportActionsList.js

+5
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,19 @@ function ReportActionsList({
319319
// Iterate through the report actions and set appropriate unread marker.
320320
// This is to avoid a warning of:
321321
// Cannot update a component (ReportActionsList) while rendering a different component (CellRenderer).
322+
let markerFound = false;
322323
_.each(sortedReportActions, (reportAction, index) => {
323324
if (!shouldDisplayNewMarker(reportAction, index)) {
324325
return;
325326
}
327+
markerFound = true;
326328
if (!currentUnreadMarker && currentUnreadMarker !== reportAction.reportActionID) {
327329
setCurrentUnreadMarker(reportAction.reportActionID);
328330
}
329331
});
332+
if (!markerFound) {
333+
setCurrentUnreadMarker(null);
334+
}
330335
}, [sortedReportActions, report.lastReadTime, messageManuallyMarkedUnread, shouldDisplayNewMarker, currentUnreadMarker]);
331336

332337
const renderItem = useCallback(

0 commit comments

Comments
 (0)