fix: clear logout (#19823)
parent
485a9d0a7f
commit
87061bb1cb
|
@ -33,6 +33,7 @@ const Logout: FC<Props> = ({history}) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dispatch(reset())
|
dispatch(reset())
|
||||||
|
dispatch({type: 'USER_LOGGED_OUT'})
|
||||||
handleSignOut()
|
handleSignOut()
|
||||||
}, [dispatch, history])
|
}, [dispatch, history])
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,12 @@ type ReducerState = Pick<AppState, Exclude<keyof AppState, 'timeRange'>>
|
||||||
|
|
||||||
import {history} from 'src/store/history'
|
import {history} from 'src/store/history'
|
||||||
|
|
||||||
export const rootReducer = (history: History) =>
|
export const rootReducer = (history: History) => (state, action) => {
|
||||||
combineReducers<ReducerState>({
|
if (action.type === 'USER_LOGGED_OUT') {
|
||||||
|
state = undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
return combineReducers<ReducerState>({
|
||||||
router: connectRouter(history),
|
router: connectRouter(history),
|
||||||
...sharedReducers,
|
...sharedReducers,
|
||||||
autoRefresh: autoRefreshReducer,
|
autoRefresh: autoRefreshReducer,
|
||||||
|
@ -115,7 +119,8 @@ export const rootReducer = (history: History) =>
|
||||||
userSettings: userSettingsReducer,
|
userSettings: userSettingsReducer,
|
||||||
variableEditor: variableEditorReducer,
|
variableEditor: variableEditorReducer,
|
||||||
VERSION: () => '',
|
VERSION: () => '',
|
||||||
})
|
})(state, action)
|
||||||
|
}
|
||||||
|
|
||||||
const composeEnhancers =
|
const composeEnhancers =
|
||||||
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
(window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
||||||
|
|
Loading…
Reference in New Issue