Update safe tokens wip

This commit is contained in:
Mikhail Mikheev 2019-04-12 18:56:09 +04:00
parent 49f000447c
commit f8d1e6801e
2 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@ type ActionReturn = {
export const updateTokenAction = createAction<string, Function, ActionReturn>(
UPDATE_SAFE_TOKENS,
(token: SafeToken): ActionReturn => ({
safeAddress,
token,
}),
)
@ -23,7 +24,7 @@ const updateActiveTokens = (safeAddress: string, tokenAddress: string) => async
) => {
const token: SafeToken = SafeTokenRecord({ address: tokenAddress })
dispatch(updateTokenAction(token))
dispatch(updateTokenAction(safeAddress, token))
}
export default updateActiveTokens

View File

@ -7,6 +7,7 @@ import { type OwnerProps } from '~/routes/safe/store/models/owner'
import { loadFromStorage } from '~/utils/storage'
import { SAFES_KEY } from '~/logic/safe/utils'
import { UPDATE_SAFE } from '~/routes/safe/store/actions/updateSafe'
import { UPDATE_SAFE_TOKENS } from '~/routes/safe/store/actions/updateActiveTokens'
export const SAFE_REDUCER_ID = 'safes'
@ -66,6 +67,7 @@ export default handleActions<State, *>(
return state.set(safe.address, safe)
},
[UPDATE_SAFE_TOKENS]: (state: State, action: ActionType<Function>):
},
Map(),
)