Skip to content

Commit

Permalink
duration should only be added for new loans
Browse files Browse the repository at this point in the history
  • Loading branch information
brightiron committed Dec 29, 2023
1 parent 22aebb2 commit 359df30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const CreateOrRepayLoan = ({
const repayLoan = useRepayLoan();

const maturityDate = loan ? new Date(Number(loan.expiry.toString()) * 1000) : new Date();
maturityDate.setDate(maturityDate.getDate() + Number(duration || 0));
!loan && maturityDate.setDate(maturityDate.getDate() + Number(duration || 0));

const [paymentAmount, setPaymentAmount] = useState(new DecimalBigNumber("0"));
const [collateralAmount, setCollateralAmount] = useState(new DecimalBigNumber("0"));
Expand Down

0 comments on commit 359df30

Please sign in to comment.