diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 10e8d0d8f983..960766b57236 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -821,10 +821,6 @@ function addComment(reportID: string, text: string) { addActions(reportID, text); } -function reportActionsExist(reportID: string): boolean { - return allReportActions?.[reportID] !== undefined; -} - function updateChatName(reportID: string, reportName: string, type: typeof CONST.REPORT.CHAT_TYPE.GROUP | typeof CONST.REPORT.CHAT_TYPE.TRIP_ROOM) { const optimisticData: OnyxUpdate[] = [ { @@ -959,12 +955,7 @@ function openReport( return; } - const optimisticReport = reportActionsExist(reportID) - ? {} - : { - reportName: allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.reportName ?? CONST.REPORT.DEFAULT_REPORT_NAME, - }; - + const optimisticReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index 43e4ae0e8a78..1ba0e7dbd1c5 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -372,7 +372,7 @@ describe('Unread Indicators', () => { const hintText = translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNameTexts = screen.queryAllByLabelText(hintText, {includeHiddenElements: true}); expect(displayNameTexts).toHaveLength(2); - expect((displayNameTexts.at(0)?.props?.style as TextStyle)?.fontWeight).toBe(FontUtils.fontWeight.normal); + expect((displayNameTexts.at(0)?.props?.style as TextStyle)?.fontWeight).toBe(FontUtils.fontWeight.bold); expect(screen.getAllByText('C User').at(0)).toBeOnTheScreen(); expect((displayNameTexts.at(1)?.props?.style as TextStyle)?.fontWeight).toBe(FontUtils.fontWeight.bold); expect(screen.getByText('B User', {includeHiddenElements: true})).toBeOnTheScreen();