Skip to content

Commit

Permalink
Merge pull request #49770 from c3024/correct-unread-marker-for-thread…
Browse files Browse the repository at this point in the history
…s-with-unread-messages

(cherry picked from commit dbcd30e)

(CP triggered by thienlnam)
  • Loading branch information
dangrous authored and OSBotify committed Sep 27, 2024
1 parent 3c243a9 commit fb91699
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function ReportActionsList({
}

const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? '';
if (mostRecentReportActionCreated === unreadMarkerTime) {
if (mostRecentReportActionCreated <= unreadMarkerTime) {
return;
}

Expand Down
14 changes: 3 additions & 11 deletions tests/perf-test/ReportActionsList.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,23 @@ beforeEach(() => {
});

function ReportActionsListWrapper() {
const reportActions = ReportTestUtils.getMockedSortedReportActions(500);
const lastVisibleActionCreated = reportActions[0].created;
const report = {
...LHNTestUtilsModule.getFakeReport(),
lastVisibleActionCreated,
lastReadTime: lastVisibleActionCreated,
};

return (
<ComposeProviders components={[OnyxProvider, LocaleContextProvider, ReportAttachmentsProvider]}>
<ReactionListContext.Provider value={mockRef}>
<ActionListContext.Provider value={mockRef}>
<ReportActionsList
parentReportAction={createRandomReportAction(1)}
parentReportActionForTransactionThread={undefined}
sortedReportActions={reportActions}
report={report}
sortedReportActions={ReportTestUtils.getMockedSortedReportActions(500)}
report={LHNTestUtilsModule.getFakeReport()}
onLayout={mockOnLayout}
onScroll={mockOnScroll}
onContentSizeChange={() => {}}
listID={1}
loadOlderChats={mockLoadChats}
loadNewerChats={mockLoadChats}
transactionThreadReport={LHNTestUtilsModule.getFakeReport()}
reportActions={reportActions}
reportActions={ReportTestUtils.getMockedSortedReportActions(500)}
/>
</ActionListContext.Provider>
</ReactionListContext.Provider>
Expand Down

0 comments on commit fb91699

Please sign in to comment.