From f8d1e6801e78e9ddf22fe48aeded3a261b20176b Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Fri, 12 Apr 2019 18:56:09 +0400 Subject: [PATCH] Update safe tokens wip --- src/routes/safe/store/actions/updateActiveTokens.js | 3 ++- src/routes/safe/store/reducer/safe.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/safe/store/actions/updateActiveTokens.js b/src/routes/safe/store/actions/updateActiveTokens.js index d9d19fad..e573c489 100644 --- a/src/routes/safe/store/actions/updateActiveTokens.js +++ b/src/routes/safe/store/actions/updateActiveTokens.js @@ -14,6 +14,7 @@ type ActionReturn = { export const updateTokenAction = createAction( 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 diff --git a/src/routes/safe/store/reducer/safe.js b/src/routes/safe/store/reducer/safe.js index 41115961..352fad20 100644 --- a/src/routes/safe/store/reducer/safe.js +++ b/src/routes/safe/store/reducer/safe.js @@ -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( return state.set(safe.address, safe) }, + [UPDATE_SAFE_TOKENS]: (state: State, action: ActionType): }, Map(), )