Skip to content

Commit

Permalink
fix: set null to unread marker when there are no new messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sangar-1028 committed Oct 27, 2023
1 parent eef8347 commit 50f22be
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 50f22be

Please sign in to comment.