Skip to content

Commit 2d1f8cd

Browse files
authored
Merge pull request Expensify#48445 from bernhardoj/fix/47735-unread-line-shows-on-a-new-msg
Fix unread indicator isn't cleared when deleting the unread message
2 parents 5db0996 + 2d880ca commit 2d1f8cd

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/pages/home/report/ReportActionsList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function ReportActionsList({
278278
}
279279

280280
const mostRecentReportActionCreated = sortedVisibleReportActions[0]?.created ?? '';
281-
if (mostRecentReportActionCreated <= unreadMarkerTime) {
281+
if (mostRecentReportActionCreated === unreadMarkerTime) {
282282
return;
283283
}
284284

tests/perf-test/ReportActionsList.perf-test.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,31 @@ beforeEach(() => {
8282
});
8383

8484
function ReportActionsListWrapper() {
85+
const reportActions = ReportTestUtils.getMockedSortedReportActions(500);
86+
const lastVisibleActionCreated = reportActions[0].created;
87+
const report = {
88+
...LHNTestUtilsModule.getFakeReport(),
89+
lastVisibleActionCreated,
90+
lastReadTime: lastVisibleActionCreated,
91+
};
92+
8593
return (
8694
<ComposeProviders components={[OnyxProvider, LocaleContextProvider, WindowDimensionsProvider, ReportAttachmentsProvider]}>
8795
<ReactionListContext.Provider value={mockRef}>
8896
<ActionListContext.Provider value={mockRef}>
8997
<ReportActionsList
9098
parentReportAction={createRandomReportAction(1)}
9199
parentReportActionForTransactionThread={undefined}
92-
sortedReportActions={ReportTestUtils.getMockedSortedReportActions(500)}
93-
report={LHNTestUtilsModule.getFakeReport()}
100+
sortedReportActions={reportActions}
101+
report={report}
94102
onLayout={mockOnLayout}
95103
onScroll={mockOnScroll}
96104
onContentSizeChange={() => {}}
97105
listID={1}
98106
loadOlderChats={mockLoadChats}
99107
loadNewerChats={mockLoadChats}
100108
transactionThreadReport={LHNTestUtilsModule.getFakeReport()}
101-
reportActions={ReportTestUtils.getMockedSortedReportActions(500)}
109+
reportActions={reportActions}
102110
/>
103111
</ActionListContext.Provider>
104112
</ReactionListContext.Provider>

0 commit comments

Comments
 (0)