1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Simplify return of existing token in getSymbolAndDecimals

This commit is contained in:
Dan 2018-04-27 21:38:57 -02:30
parent b71dbf52d1
commit 9f9e8789cc

View File

@ -17,10 +17,7 @@ function tokenInfoGetter () {
async function getSymbolAndDecimals (tokenAddress, existingTokens = []) {
const existingToken = existingTokens.find(({ address }) => tokenAddress === address)
if (existingToken) {
return {
symbol: existingToken.symbol,
decimals: existingToken.decimals,
}
return existingToken
}
let result = []