1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix token decimal type (#8670)

The `decimals` property of tokens was being set as a string instead of
a Number for any tokens added via `getTokenParams`. It's now cast to a
Number instead.
This commit is contained in:
Mark Stacey 2020-05-27 22:33:59 -03:00 committed by GitHub
parent 145edbe99d
commit e89540fd94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2216,7 +2216,7 @@ export function getTokenParams (tokenAddress) {
return fetchSymbolAndDecimals(tokenAddress, existingTokens)
.then(({ symbol, decimals }) => {
dispatch(addToken(tokenAddress, symbol, decimals))
dispatch(addToken(tokenAddress, symbol, Number(decimals)))
dispatch(loadingTokenParamsFinished())
})
}