Skip to content

Commit

Permalink
Merge pull request Expensify#48445 from bernhardoj/fix/47735-unread-l…
Browse files Browse the repository at this point in the history
…ine-shows-on-a-new-msg

Fix unread indicator isn't cleared when deleting the unread message
  • Loading branch information
iwiznia authored Sep 3, 2024
2 parents 5db0996 + 2d880ca commit 2d1f8cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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 @@ -278,7 +278,7 @@ function ReportActionsList({
}

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

Expand Down
14 changes: 11 additions & 3 deletions tests/perf-test/ReportActionsList.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,31 @@ 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, WindowDimensionsProvider, ReportAttachmentsProvider]}>
<ReactionListContext.Provider value={mockRef}>
<ActionListContext.Provider value={mockRef}>
<ReportActionsList
parentReportAction={createRandomReportAction(1)}
parentReportActionForTransactionThread={undefined}
sortedReportActions={ReportTestUtils.getMockedSortedReportActions(500)}
report={LHNTestUtilsModule.getFakeReport()}
sortedReportActions={reportActions}
report={report}
onLayout={mockOnLayout}
onScroll={mockOnScroll}
onContentSizeChange={() => {}}
listID={1}
loadOlderChats={mockLoadChats}
loadNewerChats={mockLoadChats}
transactionThreadReport={LHNTestUtilsModule.getFakeReport()}
reportActions={ReportTestUtils.getMockedSortedReportActions(500)}
reportActions={reportActions}
/>
</ActionListContext.Provider>
</ReactionListContext.Provider>
Expand Down

0 comments on commit 2d1f8cd

Please sign in to comment.