From fb91699a8c2ac5c8cff16f745529ab2586a70d87 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen <5487802+dangrous@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:32:09 -0700 Subject: [PATCH] Merge pull request #49770 from c3024/correct-unread-marker-for-threads-with-unread-messages (cherry picked from commit dbcd30ecb787fd369f9791db9bc01b2f3737690d) (CP triggered by thienlnam) --- src/pages/home/report/ReportActionsList.tsx | 2 +- tests/perf-test/ReportActionsList.perf-test.tsx | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 9ff8762956d7..8f5fc907a962 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -268,7 +268,7 @@ function ReportActionsList({ } const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? ''; - if (mostRecentReportActionCreated === unreadMarkerTime) { + if (mostRecentReportActionCreated <= unreadMarkerTime) { return; } diff --git a/tests/perf-test/ReportActionsList.perf-test.tsx b/tests/perf-test/ReportActionsList.perf-test.tsx index 8f4c39d5f7a2..94a1050e98ce 100644 --- a/tests/perf-test/ReportActionsList.perf-test.tsx +++ b/tests/perf-test/ReportActionsList.perf-test.tsx @@ -81,14 +81,6 @@ beforeEach(() => { }); function ReportActionsListWrapper() { - const reportActions = ReportTestUtils.getMockedSortedReportActions(500); - const lastVisibleActionCreated = reportActions[0].created; - const report = { - ...LHNTestUtilsModule.getFakeReport(), - lastVisibleActionCreated, - lastReadTime: lastVisibleActionCreated, - }; - return ( @@ -96,8 +88,8 @@ function ReportActionsListWrapper() { {}} @@ -105,7 +97,7 @@ function ReportActionsListWrapper() { loadOlderChats={mockLoadChats} loadNewerChats={mockLoadChats} transactionThreadReport={LHNTestUtilsModule.getFakeReport()} - reportActions={reportActions} + reportActions={ReportTestUtils.getMockedSortedReportActions(500)} />