default to zero wallet balance in swap ui

This commit is contained in:
Tyler Shipe 2021-12-19 15:23:35 -05:00
parent f842bb54d8
commit 0578903bb6
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ const JupiterForm: FunctionComponent = () => {
return t.account.mint.toString() === inputTokenInfo?.address
})
const largestTokenAccount = sortBy(walletToken, 'uiBalance').reverse()[0]
return largestTokenAccount?.uiBalance
return largestTokenAccount?.uiBalance || 0.0
}
return 0.0
@ -220,7 +220,7 @@ const JupiterForm: FunctionComponent = () => {
return t.account.mint.toString() === outputTokenInfo?.address
})
const largestTokenAccount = sortBy(walletToken, 'uiBalance').reverse()[0]
return largestTokenAccount?.uiBalance
return largestTokenAccount?.uiBalance || 0.0
}
return 0.0
}