mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-06 12:04:11 +05:30
#107: preserve user language after logout. Preserve user guest language after page refresh
This commit is contained in:
parent
42993e1d1d
commit
25eeac6074
@ -44,9 +44,11 @@ export function setUser(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function logout() {
|
export function logout() {
|
||||||
return (dispatch) => {
|
return (dispatch, getState) => {
|
||||||
dispatch(setUser({isGuest: true}));
|
dispatch(setUser({
|
||||||
dispatch(changeLang());
|
lang: getState().user.lang,
|
||||||
|
isGuest: true
|
||||||
|
}));
|
||||||
dispatch(routeActions.push('/login'));
|
dispatch(routeActions.push('/login'));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,6 @@ export function factory(store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// auto-detect guests language
|
// auto-detect guests language
|
||||||
store.dispatch(changeLang()).then(resolve, reject);
|
store.dispatch(changeLang(user.lang)).then(resolve, reject);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user