From 13276b8d6a861c4a55faa5d690c157890333435c Mon Sep 17 00:00:00 2001 From: tomivm Date: Thu, 4 Aug 2022 17:14:16 -0300 Subject: [PATCH] localize user during logout --- src/components/Account/Login/Login.actions.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/Account/Login/Login.actions.js b/src/components/Account/Login/Login.actions.js index 249abe48a..9ce5ebea1 100644 --- a/src/components/Account/Login/Login.actions.js +++ b/src/components/Account/Login/Login.actions.js @@ -6,7 +6,11 @@ import { changePitch, changeRate } from '../../../providers/SpeechProvider/SpeechProvider.actions'; -import { disableTour } from '../../App/App.actions'; +import { + disableTour, + setUnloggedUserLocation, + updateUnloggedUserLocation +} from '../../App/App.actions'; import { getVoiceURI } from '../../../i18n'; export function loginSuccess(payload) { @@ -17,6 +21,14 @@ export function loginSuccess(payload) { } export function logout() { + return async dispatch => { + dispatch(setUnloggedUserLocation(null)); + dispatch(updateUnloggedUserLocation()); + dispatch(logoutSuccess()); + }; +} + +function logoutSuccess() { return { type: LOGOUT };