1 import { combineReducers } from 'redux'
2 import { routerReducer as routing} from 'react-router-redux'
3 import form from 'features/form/reducers'
4 import accessControl from 'features/accessControl/reducers'
5 import { reducers as account } from 'features/accounts'
6 import { reducers as app } from 'features/app'
7 import { reducers as asset } from 'features/assets'
8 import { reducers as balance } from 'features/balances'
9 import { reducers as core } from 'features/core'
10 import { reducers as initialization } from 'features/initialization'
11 import { reducers as mockhsm } from 'features/mockhsm'
12 import { reducers as testnet } from 'features/testnet'
13 import { reducers as transaction } from 'features/transactions'
14 import { reducers as transactionFeed } from 'features/transactionFeeds'
15 import { reducers as tutorial } from 'features/tutorial'
16 import { reducers as unspent } from 'features/unspents'
17 import { reducers as peer } from 'features/peers'
18 import { clear as clearStorage } from 'utility/localStorage'
20 const makeRootReducer = () => (state, action) => {
21 if (action.type == 'UPDATE_CORE_INFO' &&
22 !action.param.isConfigured) {
25 // routing: state.routing,
28 // if (state.core.blockchainId == (action.param.blockchainId || 0)) {
29 // newState.core = state.core
33 } else if (action.type == 'USER_LOG_OUT') {
34 // TODO: see if we can't move this outside of a reducer..
36 // Actions still may fire after the location redirect, so make sure they
37 // fire against blank state, and the local storage listener doesn't
41 // Clear tokens and other state from local storage.
44 // Finally, reboot the entire dashboard app via a hard redirect.
45 window.location.href = '/'
48 return combineReducers({
67 export default makeRootReducer