1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-27 09:28:19 +00:00

Fixed browser select crash

This commit is contained in:
Vladimir Volek 2018-11-06 16:13:07 +01:00
parent bc6b47eb62
commit 76b66c348c

View File

@ -123,9 +123,11 @@ const AccountSummary = (props: Props) => {
loadingMessage={() => 'Loading...'} loadingMessage={() => 'Loading...'}
noOptionsMessage={() => 'Token not found'} noOptionsMessage={() => 'Token not found'}
onChange={(token) => { onChange={(token) => {
const isAdded = tokens.find(t => t.symbol === token.symbol); if (token.name) {
if (!isAdded) { const isAdded = tokens.find(t => t.symbol === token.symbol);
props.addToken(token, account); if (!isAdded) {
props.addToken(token, account);
}
} }
}} }}
loadOptions={input => props.loadTokens(input, account.network)} loadOptions={input => props.loadTokens(input, account.network)}
@ -140,7 +142,6 @@ const AccountSummary = (props: Props) => {
getOptionValue={option => option.symbol} getOptionValue={option => option.symbol}
/> />
</AsyncSelectWrapper> </AsyncSelectWrapper>
<AddedTokensWrapper> <AddedTokensWrapper>
{tokens.map(token => ( {tokens.map(token => (
<AddedToken <AddedToken