Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
{
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/UnreadIndicatorsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this test affected with the change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be not, does it pass on main?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is currently passing in main

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();
Expand Down