Skip to content

Commit

Permalink
typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonals committed Feb 14, 2024
1 parent c44ef01 commit 4df6a65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money
const [isConfirmModalVisible, setIsConfirmModalVisible] = useState(false);

const cancelPayment = useCallback(() => {

Check failure on line 69 in src/components/MoneyReportHeader.tsx

View workflow job for this annotation

GitHub Actions / lint

Prefer an early return to a conditionally-wrapped function body
// @ts-expect-error TODO: Remove this once IOU (https://github.com/Expensify/App/issues/24926) is migrated to TypeScript.
IOU.cancelPayment(moneyRequestReport, chatReport);
setIsConfirmModalVisible(false);
if (chatReport) {
IOU.cancelPayment(moneyRequestReport, chatReport);
setIsConfirmModalVisible(false);
}
}, [moneyRequestReport, chatReport]);

const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy);
Expand Down Expand Up @@ -135,6 +136,7 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money
policyID={moneyRequestReport.policyID}
chatReportID={chatReport?.reportID}
iouReport={moneyRequestReport}
// @ts-expect-error TODO: Remove this once IOU (https://github.com/Expensify/App/issues/24926) is migrated to TypeScript.
onPress={(paymentType: PaymentType) => IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport)}
enablePaymentsRoute={ROUTES.ENABLE_PAYMENTS}
addBankAccountRoute={bankAccountRoute}
Expand Down

0 comments on commit 4df6a65

Please sign in to comment.