Skip to content

Commit b31fcf6

Browse files
authored
Merge pull request Expensify#87518 from Expensify/claude-fixUnreadMarkerFlash
Fix unread marker flash at chat beginning after sign-in
2 parents 2f0c2fb + 0790afb commit b31fcf6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/pages/inbox/report/ReportActionsList.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,17 @@ function ReportActionsList({
260260
// eslint-disable-next-line react-hooks/exhaustive-deps
261261
}, [report.reportID]);
262262

263+
// When lastReadTime transitions from empty to a real value (e.g., data hasn't
264+
// loaded yet after sign-in), update the marker so it uses the fresh value
265+
// instead of the empty string from initial mount.
266+
useEffect(() => {
267+
if (reportLastReadTime === '' || unreadMarkerTime !== '') {
268+
return;
269+
}
270+
setUnreadMarkerTime(reportLastReadTime);
271+
// eslint-disable-next-line react-hooks/exhaustive-deps
272+
}, [reportLastReadTime]);
273+
263274
const prevUnreadMarkerReportActionID = useRef<string | null>(null);
264275

265276
/**

0 commit comments

Comments
 (0)