mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Merge pull request #747 from sharetribe/clear-sessionstorage
Clear sessionstorage
This commit is contained in:
commit
c45fc8b69f
1 changed files with 6 additions and 0 deletions
|
|
@ -15,6 +15,12 @@ const appReducer = combineReducers({ ...globalReducers, ...pageReducers });
|
|||
const createReducer = () => {
|
||||
return (state, action) => {
|
||||
const appState = action.type === USER_LOGOUT ? undefined : state;
|
||||
|
||||
// Clear sessionStorage when logging out.
|
||||
if (action.type === USER_LOGOUT && typeof window !== 'undefined' && !!window.sessionStorage) {
|
||||
window.sessionStorage.clear();
|
||||
}
|
||||
|
||||
return appReducer(appState, action);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue