fix activate token for all safes after changing activeTokens from list to set

This commit is contained in:
Mikhail Mikheev 2019-11-15 14:09:14 +04:00
parent 0214b05d69
commit 4603d71820
3 changed files with 1010 additions and 45 deletions

View File

@ -36,7 +36,7 @@
"@material-ui/core": "4.6.1",
"@material-ui/icons": "4.5.1",
"@portis/web3": "^2.0.0-beta.45",
"@testing-library/jest-dom": "4.2.3",
"@testing-library/jest-dom": "4.2.4",
"@toruslabs/torus-embed": "0.2.6",
"@walletconnect/web3-provider": "^1.0.0-beta.37",
"@welldone-software/why-did-you-render": "3.3.9",
@ -53,8 +53,8 @@
"notistack": "https://github.com/gnosis/notistack.git#v0.9.4",
"optimize-css-assets-webpack-plugin": "5.0.3",
"qrcode.react": "1.0.0",
"react": "16.11.0",
"react-dom": "16.11.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-final-form": "6.3.0",
"react-final-form-listeners": "^1.0.2",
"react-hot-loader": "4.12.17",
@ -68,7 +68,7 @@
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"squarelink": "^1.1.3",
"web3": "1.2.2",
"web3": "1.2.3",
"web3connect": "^1.0.0-beta.23"
},
"devDependencies": {
@ -118,7 +118,7 @@
"eslint-config-airbnb": "18.0.1",
"eslint-plugin-flowtype": "4.4.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "23.0.3",
"eslint-plugin-jest": "23.0.4",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.16.0",
"ethereumjs-abi": "0.6.8",

View File

@ -46,9 +46,9 @@ export default handleActions<SafeReducerState, *>(
const tokenAddress = action.payload
const newState = state.withMutations((map) => {
map.keySeq().forEach((safeAddress) => {
const safeActiveTokens = map.getIn([safeAddress, 'activeTokens'])
const activeTokens = safeActiveTokens.push(tokenAddress)
map.get('safes').keySeq().forEach((safeAddress) => {
const safeActiveTokens = map.getIn(['safes', safeAddress, 'activeTokens'])
const activeTokens = safeActiveTokens.add(tokenAddress)
map.updateIn(['safes', safeAddress], (prevSafe) => prevSafe.merge({ activeTokens }))
})

1039
yarn.lock

File diff suppressed because it is too large Load Diff