|
|
@ -12,7 +12,7 @@ import { Interval } from './interval'; |
|
|
|
import { SyncOnly } from './syncOnly'; |
|
|
|
import { Errors } from './errors'; |
|
|
|
|
|
|
|
const rootReducer = combineReducers({ |
|
|
|
const appReducer = combineReducers({ |
|
|
|
AddCoin, |
|
|
|
toaster, |
|
|
|
Main, |
|
|
@ -26,4 +26,14 @@ const rootReducer = combineReducers({ |
|
|
|
routing: routerReducer, |
|
|
|
}); |
|
|
|
|
|
|
|
// reset app state on logout
|
|
|
|
const initialState = appReducer({}, {}); |
|
|
|
const rootReducer = (state, action) => { |
|
|
|
if (action.type === 'LOGOUT') { |
|
|
|
state = initialState; |
|
|
|
} |
|
|
|
|
|
|
|
return appReducer(state, action); |
|
|
|
} |
|
|
|
|
|
|
|
export default rootReducer; |
|
|
|