Skip to content

Commit

Permalink
fix withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser committed Nov 8, 2024
1 parent bf5f6a9 commit a1f94fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions centrifuge-app/src/pages/Loan/FinanceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,11 @@ export function useWithdraw(poolId: string, borrower: CombinedSubstrateAccount,
amount={amount}
/>
),
isValid: (_: { values: Pick<FinanceValues, 'withdraw'> }) => {
isValid: () => {
const withdrawalAddresses = Object.values(selectedAddressIndexByCurrency).filter((index) => index !== -1)
return source === 'reserve' ? amount.lte(totalAvailable) && !!withdrawalAddresses.length : true
},
getBatch: ({ values }: { values: Pick<FinanceValues, 'withdraw'> }) => {
if (!values.withdraw) return of([])
getBatch: () => {
const withdrawalAddresses = Object.values(selectedAddressIndexByCurrency).filter((index) => index !== -1)
if (!withdrawalAddresses.length) return of([])
return combineLatest(
Expand Down

0 comments on commit a1f94fb

Please sign in to comment.