Skip to content

Commit

Permalink
checking repor transactions length to compute if has held expenses
Browse files Browse the repository at this point in the history
  • Loading branch information
rlinoz committed Jun 26, 2024
1 parent 811f154 commit c8ed13f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6556,7 +6556,7 @@ function hasHeldExpenses(iouReportID?: string): boolean {
*/
function hasOnlyHeldExpenses(iouReportID: string, transactions?: OnyxCollection<Transaction>): boolean {
const reportTransactions = TransactionUtils.getAllReportTransactions(iouReportID, transactions);
return !reportTransactions.some((transaction) => !TransactionUtils.isOnHold(transaction));
return reportTransactions.length > 0 && !reportTransactions.some((transaction) => !TransactionUtils.isOnHold(transaction));
}

/**
Expand Down

0 comments on commit c8ed13f

Please sign in to comment.