Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Jul 30, 2024
1 parent 3091535 commit 5735a24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions centrifuge-app/src/pages/Loan/ExternalRepayForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ export function ExternalRepayForm({ loan, destination }: { loan: ExternalLoan; d
const repayFormRef = React.useRef<HTMLFormElement>(null)
useFocusInvalidInput(repayForm, repayFormRef)

if (loan.status === 'Closed' || ('valuationMethod' in loan.pricing && loan.pricing.valuationMethod !== 'oracle')) {
return null
}

const debt = loan.outstandingDebt?.toDecimal() || Dec(0)
const debt = ('outstandingDebt' in loan && loan.outstandingDebt?.toDecimal()) || Dec(0)
const { maxAvailable, maxInterest, totalRepay } = React.useMemo(() => {
const outstandingInterest = (loan as ActiveLoan).outstandingInterest.toDecimal() ?? Dec(0)
const { quantity, interest, amountAdditional, price } = repayForm.values
Expand All @@ -146,6 +142,10 @@ export function ExternalRepayForm({ loan, destination }: { loan: ExternalLoan; d
}
}, [loan, destinationLoan, balance, repayForm.values])

Check warning on line 143 in centrifuge-app/src/pages/Loan/ExternalRepayForm.tsx

View workflow job for this annotation

GitHub Actions / build-app

React Hook React.useMemo has missing dependencies: 'debt' and 'destination'. Either include them or remove the dependency array

Check warning on line 143 in centrifuge-app/src/pages/Loan/ExternalRepayForm.tsx

View workflow job for this annotation

GitHub Actions / ff-prod / build-app

React Hook React.useMemo has missing dependencies: 'debt' and 'destination'. Either include them or remove the dependency array

if (loan.status === 'Closed' || ('valuationMethod' in loan.pricing && loan.pricing.valuationMethod !== 'oracle')) {
return null
}

return (
<>
{currentFace ? (
Expand Down

0 comments on commit 5735a24

Please sign in to comment.