From 779b3a33be0c3413fbb5c1ac0ad49047943ab810 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Fri, 23 Aug 2024 14:54:27 -0400 Subject: [PATCH 1/2] fix conditional --- src/components/MoneyReportHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index ee3929292cd3..a7db76d0def8 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -106,7 +106,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const connectedIntegration = PolicyUtils.getConnectedIntegration(policy); const navigateBackToAfterDelete = useRef(); const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).some((t) => TransactionUtils.isReceiptBeingScanned(t)); - const hasOnlyPendingTransactions = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).every( + const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every( (t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t), ); const transactionIDs = allTransactions.map((t) => t.transactionID); From eb5a569942af5f4117a548d9ed683046e11f9012 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Fri, 23 Aug 2024 14:55:10 -0400 Subject: [PATCH 2/2] prettier --- src/components/MoneyReportHeader.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index a7db76d0def8..ead792f37a77 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -106,9 +106,7 @@ function MoneyReportHeader({policy, report: moneyRequestReport, transactionThrea const connectedIntegration = PolicyUtils.getConnectedIntegration(policy); const navigateBackToAfterDelete = useRef(); const hasScanningReceipt = ReportUtils.getTransactionsWithReceipts(moneyRequestReport?.reportID).some((t) => TransactionUtils.isReceiptBeingScanned(t)); - const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every( - (t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t), - ); + const hasOnlyPendingTransactions = allTransactions.length > 0 && allTransactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t)); const transactionIDs = allTransactions.map((t) => t.transactionID); const allHavePendingRTERViolation = TransactionUtils.allHavePendingRTERViolation(transactionIDs); const hasOnlyHeldExpenses = ReportUtils.hasOnlyHeldExpenses(moneyRequestReport.reportID);