From 359df30eeea97f00be1799f1ae63743df10755b9 Mon Sep 17 00:00:00 2001 From: brightiron Date: Fri, 29 Dec 2023 08:43:20 -0600 Subject: [PATCH] duration should only be added for new loans --- src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx b/src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx index 2baacd7662..56f6f0fe95 100644 --- a/src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx +++ b/src/views/Lending/Cooler/positions/CreateOrRepayLoan.tsx @@ -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"));