1 import { combineReducers } from 'redux'
2 import { routerReducer as routing} from 'react-router-redux'
3 import { reducer as form } from 'redux-form'
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 { clear as clearStorage } from 'utility/localStorage'
19 const makeRootReducer = () => (state, action) => {
20 if (action.type == 'UPDATE_CORE_INFO' &&
21 !action.param.isConfigured) {
24 // routing: state.routing,
27 // if (state.core.blockchainId == (action.param.blockchainId || 0)) {
28 // newState.core = state.core
32 } else if (action.type == 'USER_LOG_OUT') {
33 // TODO: see if we can't move this outside of a reducer..
35 // Actions still may fire after the location redirect, so make sure they
36 // fire against blank state, and the local storage listener doesn't
40 // Clear tokens and other state from local storage.
43 // Finally, reboot the entire dashboard app via a hard redirect.
44 window.location.href = '/'
47 return combineReducers({
65 export default makeRootReducer