* Replaces decimals from backend with decimals from blockchain * Removes fetching again token info from blockchain Fixs decimals cast, now we force to move from bignumber to number For data already wrong stored as string we remove it to force fetching again the decimals * Fixs missing symbol * Add description comment
This commit is contained in:
parent
c40fa07696
commit
6bdbcd234e
|
@ -128,7 +128,7 @@ export const getTokenInfos = async (tokenAddress: string) => {
|
|||
address: tokenAddress,
|
||||
name: name ? name : tokenSymbol,
|
||||
symbol: tokenSymbol,
|
||||
decimals: tokenDecimals,
|
||||
decimals: tokenDecimals.toNumber(),
|
||||
logoUri: '',
|
||||
})
|
||||
const newTokens = tokens.set(tokenAddress, savedToken)
|
||||
|
|
|
@ -11,8 +11,11 @@ import { type GlobalState } from '~/store/index'
|
|||
const loadActiveTokens = () => async (dispatch: ReduxDispatch<GlobalState>) => {
|
||||
try {
|
||||
const tokens: Map<string, TokenProps> = await getActiveTokens()
|
||||
// The filter of strings was made because of the issue #751. Please see: https://github.com/gnosis/safe-react/pull/755#issuecomment-612969340
|
||||
const tokenRecordsList: List<Token> = List(
|
||||
Object.values(tokens).map((token: TokenProps): Token => makeToken(token)),
|
||||
Object.values(tokens)
|
||||
.filter((t) => typeof t.decimals !== 'string')
|
||||
.map((token: TokenProps): Token => makeToken(token)),
|
||||
)
|
||||
|
||||
dispatch(saveTokens(tokenRecordsList))
|
||||
|
|
Loading…
Reference in New Issue