mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-01 17:52:10 +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() {
|
||||
return (dispatch) => {
|
||||
dispatch(setUser({isGuest: true}));
|
||||
dispatch(changeLang());
|
||||
return (dispatch, getState) => {
|
||||
dispatch(setUser({
|
||||
lang: getState().user.lang,
|
||||
isGuest: true
|
||||
}));
|
||||
dispatch(routeActions.push('/login'));
|
||||
};
|
||||
}
|
||||
|
@ -17,6 +17,6 @@ export function factory(store) {
|
||||
}
|
||||
|
||||
// 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