From fee83f73dec3cf4673d521a29ef11ed0167c0e57 Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Thu, 13 Jun 2024 10:49:08 -0700 Subject: [PATCH 1/4] test --- src/libs/SearchUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/SearchUtils.ts b/src/libs/SearchUtils.ts index a5d2ac1d9df2..76b805628371 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -213,7 +213,7 @@ function getSortedTransactionData(data: TransactionListItemType[], sortBy?: Sear return 0; } - // We are guaranteed that both a and b will be string or number at the same time + // We are guaranteed that both a and b will be string or number at the same time. if (typeof aValue === 'string' && typeof bValue === 'string') { return sortOrder === CONST.SORT_ORDER.ASC ? aValue.toLowerCase().localeCompare(bValue) : bValue.toLowerCase().localeCompare(aValue); } From 2f979b9e946f6fb7ebb3f1d11e1b97d2561a52c3 Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Thu, 13 Jun 2024 11:30:01 -0700 Subject: [PATCH 2/4] type check fix --- src/libs/OptionsListUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 50f5e9328986..b1e2f350147a 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -818,7 +818,7 @@ function createOption( result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result); result.iouReportAmount = ReportUtils.getMoneyRequestSpendBreakdown(result).totalDisplaySpend; - if (!hasMultipleParticipants && !ReportUtils.isGroupChat(report) && !ReportUtils.isChatRoom(report)) { + if (!hasMultipleParticipants && report && !ReportUtils.isGroupChat(report) && !ReportUtils.isChatRoom(report)) { result.login = personalDetail?.login; result.accountID = Number(personalDetail?.accountID); result.phoneNumber = personalDetail?.phoneNumber; From a42301db7aca7300c0b7682f8d48b6c79e742644 Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Thu, 13 Jun 2024 11:30:08 -0700 Subject: [PATCH 3/4] revert comment --- src/libs/SearchUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/SearchUtils.ts b/src/libs/SearchUtils.ts index 76b805628371..a5d2ac1d9df2 100644 --- a/src/libs/SearchUtils.ts +++ b/src/libs/SearchUtils.ts @@ -213,7 +213,7 @@ function getSortedTransactionData(data: TransactionListItemType[], sortBy?: Sear return 0; } - // We are guaranteed that both a and b will be string or number at the same time. + // We are guaranteed that both a and b will be string or number at the same time if (typeof aValue === 'string' && typeof bValue === 'string') { return sortOrder === CONST.SORT_ORDER.ASC ? aValue.toLowerCase().localeCompare(bValue) : bValue.toLowerCase().localeCompare(aValue); } From 099c17d36913e4b31495e2d364b49daab6fb0bae Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Thu, 13 Jun 2024 11:49:25 -0700 Subject: [PATCH 4/4] junit test fix --- src/libs/OptionsListUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index b1e2f350147a..11a689662ef4 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -818,7 +818,7 @@ function createOption( result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result); result.iouReportAmount = ReportUtils.getMoneyRequestSpendBreakdown(result).totalDisplaySpend; - if (!hasMultipleParticipants && report && !ReportUtils.isGroupChat(report) && !ReportUtils.isChatRoom(report)) { + if (!hasMultipleParticipants && (!report || (report && !ReportUtils.isGroupChat(report) && !ReportUtils.isChatRoom(report)))) { result.login = personalDetail?.login; result.accountID = Number(personalDetail?.accountID); result.phoneNumber = personalDetail?.phoneNumber;