Skip to content

Commit

Permalink
Merge pull request #53039 from cretadn22/hide-GBR-on-pending-transaction
Browse files Browse the repository at this point in the history
Hide GBR on pending transactions
  • Loading branch information
johnmlee101 authored Jan 7, 2025
2 parents 5c22754 + 0bedb06 commit cf9a023
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2873,11 +2873,16 @@ function getReasonAndReportActionThatRequiresAttention(
};
}

const iouReportActionToApproveOrPay = IOU.getIOUReportActionToApproveOrPay(optionOrReport, optionOrReport.reportID);
const iouReportID = ReportActionsUtils.getIOUReportIDFromReportActionPreview(iouReportActionToApproveOrPay);
const transactions = TransactionUtils.getAllReportTransactions(iouReportID);
const hasOnlyPendingTransactions = transactions.length > 0 && transactions.every((t) => TransactionUtils.isExpensifyCardTransaction(t) && TransactionUtils.isPending(t));

// Has a child report that is awaiting action (e.g. approve, pay, add bank account) from current user
if (optionOrReport.hasOutstandingChildRequest) {
if (optionOrReport.hasOutstandingChildRequest && !hasOnlyPendingTransactions) {
return {
reason: CONST.REQUIRES_ATTENTION_REASONS.HAS_CHILD_REPORT_AWAITING_ACTION,
reportAction: IOU.getIOUReportActionToApproveOrPay(optionOrReport, optionOrReport.reportID),
reportAction: iouReportActionToApproveOrPay,
};
}

Expand Down

0 comments on commit cf9a023

Please sign in to comment.