Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Beaman <[email protected]>
  • Loading branch information
youssef-lr and Beamanator authored Feb 29, 2024
1 parent 933e0d8 commit 902f45c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ function getChildReportNotificationPreference(reportAction: OnyxEntry<ReportActi
* Return true if:
* - report is a non-settled IOU
* - report is a draft
* - report is processing and policy's on Instant Submit
* - report is a processing expense report and its policy has Instant reporting frequency
*/
function canAddTransactionsToMoneyRequest(report: OnyxEntry<Report>): boolean {
if (!isIOUReport(report) && !isExpenseReport(report)) {
Expand Down Expand Up @@ -4992,7 +4992,7 @@ function canBeAutoReimbursed(report: OnyxEntry<Report>, policy: OnyxEntry<Policy
Create a new report if:
- we don't have an iouReport set in the chatReport
- we have one, but it's waiting on the payee adding a bank account
- we have one but we can't add more transactions to it due to: report is approved or settled, or, report is processing and policy isn't under Instant Submit
- we have one but we can't add more transactions to it due to: report is approved or settled, or report is processing and policy isn't on Instant submit reporting frequency
*/
function shouldBuildOptimisticMoneyRequestReport(existingIOUReport: OnyxEntry<Report> | undefined | null, chatReport: OnyxEntry<Report> | null): boolean {
return !existingIOUReport || hasIOUWaitingOnCurrentUserBankAccount(chatReport) || !canAddTransactionsToMoneyRequest(existingIOUReport);
Expand Down

0 comments on commit 902f45c

Please sign in to comment.