reducer fix
This commit is contained in:
parent
f8d1e6801e
commit
413cfa39d4
|
@ -8,7 +8,7 @@ export type TokenProps = {
|
|||
symbol: string,
|
||||
decimals: number,
|
||||
logoUri: string,
|
||||
balance: string
|
||||
balance: string,
|
||||
}
|
||||
|
||||
export const makeToken: RecordFactory<TokenProps> = Record({
|
||||
|
|
|
@ -4,7 +4,7 @@ import updateActiveTokens from '~/routes/safe/store/actions/updateActiveTokens'
|
|||
|
||||
export type Actions = {
|
||||
fetchTokens: Function,
|
||||
updateActiveTokens: Function
|
||||
updateActiveTokens: Function,
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
|
@ -29,9 +29,7 @@ export const calculateBalanceOf = async (tokenAddress: string, safeAddress: stri
|
|||
return new BigNumber(balance).div(10 ** decimals).toString()
|
||||
}
|
||||
|
||||
const fetchTokenBalances = (safe: Safe, tokens: List<Token>) => async (
|
||||
dispatch: ReduxDispatch<GlobalState>,
|
||||
) => {
|
||||
const fetchTokenBalances = (safe: Safe, tokens: List<Token>) => async (dispatch: ReduxDispatch<GlobalState>) => {
|
||||
if (!safe || !tokens || !tokens.size) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -67,7 +67,10 @@ export default handleActions<State, *>(
|
|||
|
||||
return state.set(safe.address, safe)
|
||||
},
|
||||
[UPDATE_SAFE_TOKENS]: (state: State, action: ActionType<Function>):
|
||||
[UPDATE_SAFE_TOKENS]: (state: State, action: ActionType<Function>): State => {
|
||||
const { safeAddress, token } = action.payload
|
||||
const tokens = state.getIn([safeAddress, 'tokens'])
|
||||
}
|
||||
},
|
||||
Map(),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue