Skip to content

Commit

Permalink
fix: sometimes the last visible action is part of an old thread
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverjam committed Apr 17, 2024
1 parent e40dd6e commit f05942d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f05942d

Please sign in to comment.