WA-521 Do not init redux with txs data when loading app

This commit is contained in:
apanizo 2018-08-14 12:59:52 +02:00
parent 1c07e31a34
commit 5451c15274
2 changed files with 4 additions and 5 deletions

View File

@ -3,14 +3,11 @@ import { List, Map } from 'immutable'
import { handleActions, type ActionType } from 'redux-actions' import { handleActions, type ActionType } from 'redux-actions'
import addTransactions, { ADD_TRANSACTIONS } from '~/routes/safe/store/actions/addTransactions' import addTransactions, { ADD_TRANSACTIONS } from '~/routes/safe/store/actions/addTransactions'
import { type Transaction } from '~/routes/safe/store/model/transaction' import { type Transaction } from '~/routes/safe/store/model/transaction'
import { loadSafeTransactions } from '~/routes/safe/store/actions/fetchTransactions'
export const TRANSACTIONS_REDUCER_ID = 'transactions' export const TRANSACTIONS_REDUCER_ID = 'transactions'
export type State = Map<string, List<Transaction>> export type State = Map<string, List<Transaction>>
export const transactionsInitialState = () => loadSafeTransactions()
export default handleActions({ export default handleActions({
[ADD_TRANSACTIONS]: (state: State, action: ActionType<typeof addTransactions>): State => [ADD_TRANSACTIONS]: (state: State, action: ActionType<typeof addTransactions>): State =>
action.payload, action.payload,

View File

@ -6,7 +6,7 @@ import thunk from 'redux-thunk'
import provider, { PROVIDER_REDUCER_ID, type State as ProviderState } from '~/logic/wallets/store/reducer/provider' import provider, { PROVIDER_REDUCER_ID, type State as ProviderState } from '~/logic/wallets/store/reducer/provider'
import safe, { SAFE_REDUCER_ID, type State as SafeState } from '~/routes/safe/store/reducer/safe' import safe, { SAFE_REDUCER_ID, type State as SafeState } from '~/routes/safe/store/reducer/safe'
import tokens, { TOKEN_REDUCER_ID, type State as TokensState } from '~/routes/tokens/store/reducer/tokens' import tokens, { TOKEN_REDUCER_ID, type State as TokensState } from '~/routes/tokens/store/reducer/tokens'
import transactions, { type State as TransactionsState, transactionsInitialState, TRANSACTIONS_REDUCER_ID } from '~/routes/safe/store/reducer/transactions' import transactions, { type State as TransactionsState, TRANSACTIONS_REDUCER_ID } from '~/routes/safe/store/reducer/transactions'
export const history = createBrowserHistory() export const history = createBrowserHistory()
@ -32,11 +32,13 @@ const reducers: Reducer<GlobalState> = combineReducers({
[TRANSACTIONS_REDUCER_ID]: transactions, [TRANSACTIONS_REDUCER_ID]: transactions,
}) })
/*
const initialState = { const initialState = {
[TRANSACTIONS_REDUCER_ID]: transactionsInitialState(), [TRANSACTIONS_REDUCER_ID]: transactionsInitialState(),
} }
*/
export const store: Store<GlobalState> = createStore(reducers, initialState, finalCreateStore) export const store: Store<GlobalState> = createStore(reducers, {}, finalCreateStore)
export const aNewStore = (localState?: Object): Store<GlobalState> => export const aNewStore = (localState?: Object): Store<GlobalState> =>
createStore(reducers, localState, finalCreateStore) createStore(reducers, localState, finalCreateStore)