From cdc0b4070fddee8eaa697e15253cb4fe7d5cb3de Mon Sep 17 00:00:00 2001 From: ian-jh Date: Thu, 29 Aug 2019 17:44:33 -0400 Subject: [PATCH] fix loading issues --- src/components/CurrencyInputPanel/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/CurrencyInputPanel/index.js b/src/components/CurrencyInputPanel/index.js index 50ef3d0425..a5fb9b238d 100644 --- a/src/components/CurrencyInputPanel/index.js +++ b/src/components/CurrencyInputPanel/index.js @@ -3,6 +3,7 @@ import { Link } from 'react-router-dom' import { useTranslation } from 'react-i18next' import { ethers } from 'ethers' import { BigNumber } from '@uniswap/sdk' +import { useWeb3Context } from 'web3-react' import styled from 'styled-components' import escapeStringRegex from 'escape-string-regexp' import { darken } from 'polished' @@ -428,6 +429,8 @@ function CurrencySelectModal({ isOpen, onDismiss, onTokenSelect, allBalances }) const allTokens = useAllTokenDetails() + const { account } = useWeb3Context() + // BigNumber.js instance const ethPrice = useUSDPrice() @@ -553,8 +556,10 @@ function CurrencySelectModal({ isOpen, onDismiss, onTokenSelect, allBalances }) {balance ? ( {balance && (balance > 0 || balance === '<0.0001') ? balance : '-'} - ) : ( + ) : account ? ( + ) : ( + '-' )} {usdBalance ? (usdBalance.lt(0.01) ? '<$0.01' : '$' + formatToUsd(usdBalance)) : ''}