Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Expensify/App
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Dec 13, 2024
2 parents fe49e8a + 63636e5 commit 1d9838e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ function getAction(data: OnyxTypes.SearchResults['data'], key: string): SearchTr
const transaction = isTransaction ? data[key] : undefined;
const report = isTransaction ? data[`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`] : data[key];

// Tracked and unreported expenses don't have a report, so we return early.
if (!report) {
return CONST.SEARCH.ACTION_TYPES.VIEW;
}

// We need to check both options for a falsy value since the transaction might not have an error but the report associated with it might
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (transaction?.hasError || report.hasError) {
Expand Down

0 comments on commit 1d9838e

Please sign in to comment.