default borrows to off when withdrawing

This commit is contained in:
Tyler Shipe 2021-06-05 13:05:40 -04:00
parent eac4adc18f
commit 39a9507756
2 changed files with 6 additions and 5 deletions

View File

@ -333,11 +333,11 @@ const WithdrawModal: FunctionComponent<WithdrawModalProps> = ({
}, [maxButtonTransition])
// turn on borrow toggle when asset balance is zero
useEffect(() => {
if (withdrawTokenSymbol && getMaxForSelectedAsset() === 0) {
setIncludeBorrow(true)
}
}, [withdrawTokenSymbol])
// useEffect(() => {
// if (withdrawTokenSymbol && getMaxForSelectedAsset() === 0) {
// setIncludeBorrow(true)
// }
// }, [withdrawTokenSymbol])
if (!withdrawTokenSymbol) return null

View File

@ -32,6 +32,7 @@ export async function getWalletTokenInfo(
) {
const splAccounts = await getOwnedTokenAccounts(connection, ownerPublicKey)
const account = await connection.getAccountInfo(ownerPublicKey)
if (!account) return splAccounts
return splAccounts.concat([
{
publicKey: ownerPublicKey,