Fixing tokens sent as Array (#3621)
This commit is contained in:
parent
6d6e942d9d
commit
7610336596
@ -64,6 +64,16 @@ export default handleActions({
|
|||||||
|
|
||||||
setTokens (state, action) {
|
setTokens (state, action) {
|
||||||
const { tokens } = action;
|
const { tokens } = action;
|
||||||
|
|
||||||
|
if (Array.isArray(tokens)) {
|
||||||
|
const objTokens = tokens.reduce((_tokens, token) => {
|
||||||
|
_tokens[token.address] = token;
|
||||||
|
return _tokens;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
return Object.assign({}, state, { tokens: objTokens });
|
||||||
|
}
|
||||||
|
|
||||||
return Object.assign({}, state, { tokens });
|
return Object.assign({}, state, { tokens });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user