fix: clear logout (#19823)

pull/19818/head
Zoe Steinkamp 2020-10-26 23:06:52 -06:00 committed by GitHub
parent 485a9d0a7f
commit 87061bb1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -33,6 +33,7 @@ const Logout: FC<Props> = ({history}) => {
}
}
dispatch(reset())
dispatch({type: 'USER_LOGGED_OUT'})
handleSignOut()
}, [dispatch, history])

View File

@ -62,8 +62,12 @@ type ReducerState = Pick<AppState, Exclude<keyof AppState, 'timeRange'>>
import {history} from 'src/store/history'
export const rootReducer = (history: History) =>
combineReducers<ReducerState>({
export const rootReducer = (history: History) => (state, action) => {
if (action.type === 'USER_LOGGED_OUT') {
state = undefined
}
return combineReducers<ReducerState>({
router: connectRouter(history),
...sharedReducers,
autoRefresh: autoRefreshReducer,
@ -115,7 +119,8 @@ export const rootReducer = (history: History) =>
userSettings: userSettingsReducer,
variableEditor: variableEditorReducer,
VERSION: () => '',
})
})(state, action)
}
const composeEnhancers =
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose