Skip to content

Commit

Permalink
Merge pull request #12976 from brave/fix-exclude-erc721-tokens-from-swap
Browse files Browse the repository at this point in the history
Fix: exclude ERC-721 tokens from swap
  • Loading branch information
josheleonard authored Apr 13, 2022
2 parents 3fc6c17 + d7fc683 commit 88c71e6
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 184 deletions.
4 changes: 3 additions & 1 deletion components/brave_wallet_ui/common/hooks/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { BraveWallet, WalletAccountType } from '../../constants/types'
import { getTokensCoinType } from '../../utils/network-utils'

export default function useBalance (networks: BraveWallet.NetworkInfo[]) {
return React.useCallback((account?: WalletAccountType, token?: BraveWallet.BlockchainToken) => {
const getBalance = React.useCallback((account?: WalletAccountType, token?: BraveWallet.BlockchainToken) => {
if (!account || !token) {
return ''
}
Expand All @@ -33,4 +33,6 @@ export default function useBalance (networks: BraveWallet.NetworkInfo[]) {

return (account.tokenBalanceRegistry || {})[token.contractAddress.toLowerCase()] || ''
}, [networks])

return getBalance
}
Loading

0 comments on commit 88c71e6

Please sign in to comment.