Skip to content

Commit cdc0b40

Browse files
committed
fix loading issues
1 parent 11d85b3 commit cdc0b40

File tree

1 file changed

+6
-1
lines changed
  • src/components/CurrencyInputPanel

1 file changed

+6
-1
lines changed

src/components/CurrencyInputPanel/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'
33
import { useTranslation } from 'react-i18next'
44
import { ethers } from 'ethers'
55
import { BigNumber } from '@uniswap/sdk'
6+
import { useWeb3Context } from 'web3-react'
67
import styled from 'styled-components'
78
import escapeStringRegex from 'escape-string-regexp'
89
import { darken } from 'polished'
@@ -428,6 +429,8 @@ function CurrencySelectModal({ isOpen, onDismiss, onTokenSelect, allBalances })
428429

429430
const allTokens = useAllTokenDetails()
430431

432+
const { account } = useWeb3Context()
433+
431434
// BigNumber.js instance
432435
const ethPrice = useUSDPrice()
433436

@@ -553,8 +556,10 @@ function CurrencySelectModal({ isOpen, onDismiss, onTokenSelect, allBalances })
553556
<TokenRowRight>
554557
{balance ? (
555558
<TokenRowBalance>{balance && (balance > 0 || balance === '<0.0001') ? balance : '-'}</TokenRowBalance>
556-
) : (
559+
) : account ? (
557560
<SpinnerWrapper src={Circle} alt="loader" />
561+
) : (
562+
'-'
558563
)}
559564
<TokenRowUsd>
560565
{usdBalance ? (usdBalance.lt(0.01) ? '<$0.01' : '$' + formatToUsd(usdBalance)) : ''}

0 commit comments

Comments
 (0)