Skip to content

Commit

Permalink
Merge pull request Expensify#30485 from s-alves10/fix/issue-30359
Browse files Browse the repository at this point in the history
fix: set null to unread marker when there are no new messages
  • Loading branch information
madmax330 authored Oct 30, 2023
2 parents 74f12d4 + 50f22be commit 9281342
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,19 @@ function ReportActionsList({
// Iterate through the report actions and set appropriate unread marker.
// This is to avoid a warning of:
// Cannot update a component (ReportActionsList) while rendering a different component (CellRenderer).
let markerFound = false;
_.each(sortedReportActions, (reportAction, index) => {
if (!shouldDisplayNewMarker(reportAction, index)) {
return;
}
markerFound = true;
if (!currentUnreadMarker && currentUnreadMarker !== reportAction.reportActionID) {
setCurrentUnreadMarker(reportAction.reportActionID);
}
});
if (!markerFound) {
setCurrentUnreadMarker(null);
}
}, [sortedReportActions, report.lastReadTime, messageManuallyMarkedUnread, shouldDisplayNewMarker, currentUnreadMarker]);

const renderItem = useCallback(
Expand Down

0 comments on commit 9281342

Please sign in to comment.