File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/components/transactions/Repay Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export interface RepayActionProps extends BoxProps {
3030 repayWithATokens : boolean ;
3131 blocked ?: boolean ;
3232 maxApproveNeeded : string ;
33+ maxAmountToRepay : string ;
3334}
3435
3536export const RepayActions = ( {
@@ -42,6 +43,7 @@ export const RepayActions = ({
4243 repayWithATokens,
4344 blocked,
4445 maxApproveNeeded,
46+ maxAmountToRepay,
4547 ...props
4648} : RepayActionProps ) => {
4749 const [
@@ -198,9 +200,11 @@ export const RepayActions = ({
198200 action,
199201 txState : 'success' ,
200202 asset : poolAddress ,
201- amount : amountToRepay ,
203+ amount : amountToRepay === '-1' ? maxAmountToRepay : amountToRepay ,
202204 assetName : symbol ,
203- amountUsd : valueToBigNumber ( amountToRepay ) . multipliedBy ( poolReserve . priceInUSD ) . toString ( ) ,
205+ amountUsd : valueToBigNumber ( amountToRepay === '-1' ? maxAmountToRepay : amountToRepay )
206+ . multipliedBy ( poolReserve . priceInUSD )
207+ . toString ( ) ,
204208 } ) ;
205209
206210 queryClient . invalidateQueries ( { queryKey : queryKeysFactory . pool } ) ;
Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ export const RepayModalContent = ({
289289 isWrongNetwork = { isWrongNetwork }
290290 symbol = { modalSymbol }
291291 repayWithATokens = { repayWithATokens }
292+ maxAmountToRepay = { maxAmountToRepay . toString ( 10 ) }
292293 />
293294 </ >
294295 ) ;
You can’t perform that action at this time.
0 commit comments