From f05942daf42e8687bf60c45b0a55160deee55572 Mon Sep 17 00:00:00 2001 From: Jaime Liz Date: Tue, 16 Apr 2024 19:57:38 -0500 Subject: [PATCH] fix: sometimes the last visible action is part of an old thread --- src/pages/home/report/ReportActionsList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 19204958dd5f..6b1ebee23cf8 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -196,7 +196,8 @@ function ReportActionsList({ ); const lastActionIndex = sortedVisibleReportActions[0]?.reportActionID; const reportActionSize = useRef(sortedVisibleReportActions.length); - const hasNewestReportAction = sortedReportActions?.[0].created === report.lastVisibleActionCreated; + const hasNewestReportAction = + sortedReportActions?.[0].created === report.lastVisibleActionCreated || sortedReportActions.some((reportAction) => reportAction.created === report.lastVisibleActionCreated); const hasNewestReportActionRef = useRef(hasNewestReportAction); hasNewestReportActionRef.current = hasNewestReportAction; const previousLastIndex = useRef(lastActionIndex);