Skip to content

Commit

Permalink
Merge pull request #57186 from ishpaul777/fix-invoice-page
Browse files Browse the repository at this point in the history
[CP Staging] mWeb - Invoices - The back button doesn't correspond in the invoice tab on the search page
  • Loading branch information
roryabraham authored Feb 20, 2025
2 parents f5df848 + 3884f25 commit 01a9fe3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ function Search({queryJSON, onSearchListScroll, isSearchScreenFocused, contentCo
return;
}
const newTransactionList: SelectedTransactions = {};
if (type === CONST.SEARCH.DATA_TYPES.EXPENSE && !shouldGroupByReports) {
if (!shouldGroupByReports) {
data.forEach((transaction) => {
if (!Object.hasOwn(transaction, 'transactionID') || !('transactionID' in transaction)) {
return;
Expand Down
6 changes: 3 additions & 3 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ function getListItem(type: SearchDataTypes, status: SearchStatus, shouldGroupByR
if (type === CONST.SEARCH.DATA_TYPES.CHAT) {
return ChatListItem;
}
if (type === CONST.SEARCH.DATA_TYPES.EXPENSE && !shouldGroupByReports) {
if (!shouldGroupByReports) {
return TransactionListItem;
}
return ReportListItem;
Expand All @@ -536,7 +536,7 @@ function getSections(type: SearchDataTypes, status: SearchStatus, data: OnyxType
if (type === CONST.SEARCH.DATA_TYPES.CHAT) {
return getReportActionsSections(data);
}
if (type === CONST.SEARCH.DATA_TYPES.EXPENSE && !shouldGroupByReports) {
if (!shouldGroupByReports) {
return getTransactionsSections(data, metadata);
}
return getReportSections(data, metadata);
Expand All @@ -556,7 +556,7 @@ function getSortedSections(
if (type === CONST.SEARCH.DATA_TYPES.CHAT) {
return getSortedReportActionData(data as ReportActionListItemType[]);
}
if (type === CONST.SEARCH.DATA_TYPES.EXPENSE && !shouldGroupByReports) {
if (!shouldGroupByReports) {
return getSortedTransactionData(data as TransactionListItemType[], sortBy, sortOrder);
}
return getSortedReportData(data as ReportListItemType[]);
Expand Down

0 comments on commit 01a9fe3

Please sign in to comment.