diff --git a/apps/marginfi-v2-ui/src/components/AssetsList/AssetRow/AssetRow.tsx b/apps/marginfi-v2-ui/src/components/AssetsList/AssetRow/AssetRow.tsx index 04b9446add..8f5ac0d5b6 100644 --- a/apps/marginfi-v2-ui/src/components/AssetsList/AssetRow/AssetRow.tsx +++ b/apps/marginfi-v2-ui/src/components/AssetsList/AssetRow/AssetRow.tsx @@ -675,8 +675,10 @@ const AssetRow: FC<{ onClick={currentAction === "Connect" ? openWalletSelector : isDust ? closeBalance : borrowOrLend} disabled={ currentAction !== "Connect" && - ((isDust && uiToNative(bank.userInfo.tokenAccount.balance, bank.info.state.mintDecimals).isZero()) || - maxAmount === 0) + ((isDust && + uiToNative(bank.userInfo.tokenAccount.balance, bank.info.state.mintDecimals).isZero() && + currentAction == ActionType.Borrow) || + (!isDust && maxAmount === 0)) } > {isDust ? "Close" : currentAction} diff --git a/apps/marginfi-v2-ui/src/components/UserPositions/UserPositionRow/UserPositionRow.tsx b/apps/marginfi-v2-ui/src/components/UserPositions/UserPositionRow/UserPositionRow.tsx index 2561f23a6d..9758c083ab 100644 --- a/apps/marginfi-v2-ui/src/components/UserPositions/UserPositionRow/UserPositionRow.tsx +++ b/apps/marginfi-v2-ui/src/components/UserPositions/UserPositionRow/UserPositionRow.tsx @@ -189,8 +189,9 @@ const UserPositionRow: FC = ({ activeBankInfo, marginfiAcc uiToNative( activeBankInfo.userInfo.tokenAccount.balance, activeBankInfo.info.state.mintDecimals - ).isZero()) || - maxAmount === 0 + ).isZero() && + !activeBankInfo.position.isLending) || + (!isDust && maxAmount === 0) } > {isDust ? "Close" : activeBankInfo.position.isLending ? "Withdraw" : "Repay"}