Skip to content

Commit

Permalink
Borrow position: disable submit button when below min debt (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre authored Nov 26, 2024
1 parent d02fe41 commit bfa7948
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,13 @@ export function PanelUpdateBorrowPosition({

const isBelowMinDebt = debtChange.parsed && !debtChange.isEmpty && newDebt && dn.lt(newDebt, MIN_DEBT);

const allowSubmit = account.isConnected && (
const allowSubmit = (
account.isConnected
) && (
!dn.eq(loanDetails.deposit ?? dnum18(0), newLoanDetails.deposit ?? dnum18(0))
|| !dn.eq(loanDetails.debt ?? dnum18(0), newLoanDetails.debt ?? dnum18(0))
) && (
!isBelowMinDebt
);

return (
Expand Down

0 comments on commit bfa7948

Please sign in to comment.