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