diff --git a/lib/reducers/nav-reducer.js b/lib/reducers/nav-reducer.js --- a/lib/reducers/nav-reducer.js +++ b/lib/reducers/nav-reducer.js @@ -8,6 +8,7 @@ keyserverRegisterActionTypes, logOutActionTypes, deleteAccountActionTypes, + identityLogInActionTypes, } from '../actions/user-actions.js'; import { defaultCalendarQuery } from '../types/entry-types.js'; import type { BaseNavInfo } from '../types/nav-types.js'; @@ -45,7 +46,9 @@ } else if ( action.type === logOutActionTypes.success || action.type === deleteAccountActionTypes.success || - action.type === identityRegisterActionTypes.success + action.type === identityRegisterActionTypes.success || + (action.type === identityLogInActionTypes.success && + action.payload.userID !== action.payload.preRequestUserState?.id) ) { const { startDate, endDate } = defaultCalendarQuery( getConfig().platformDetails.platform, diff --git a/lib/reducers/services-access-token-reducer.js b/lib/reducers/services-access-token-reducer.js --- a/lib/reducers/services-access-token-reducer.js +++ b/lib/reducers/services-access-token-reducer.js @@ -4,6 +4,7 @@ logOutActionTypes, setAccessTokenActionType, identityRegisterActionTypes, + identityLogInActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; @@ -25,7 +26,10 @@ return null; } else if (action.type === logOutActionTypes.started) { return null; - } else if (action.type === identityRegisterActionTypes.success) { + } else if ( + action.type === identityRegisterActionTypes.success || + action.type === identityLogInActionTypes.success + ) { return action.payload.accessToken; } return state; diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js --- a/native/redux/redux-setup.js +++ b/native/redux/redux-setup.js @@ -14,6 +14,7 @@ keyserverAuthActionTypes, deleteKeyserverAccountActionTypes, identityRegisterActionTypes, + identityLogInActionTypes, } from 'lib/actions/user-actions.js'; import { setNewSessionActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import type { ThreadStoreOperation } from 'lib/ops/thread-store-ops.js'; @@ -184,6 +185,15 @@ defaultState, nonUserSpecificFieldsNative, ); + } else if ( + action.type === identityLogInActionTypes.success && + action.payload.userID !== action.payload.preRequestUserState?.id + ) { + state = resetUserSpecificState( + state, + defaultState, + nonUserSpecificFieldsNative, + ); } if ( (action.type === setNewSessionActionType && diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -8,6 +8,7 @@ deleteKeyserverAccountActionTypes, deleteAccountActionTypes, identityRegisterActionTypes, + identityLogInActionTypes, } from 'lib/actions/user-actions.js'; import { setNewSessionActionType } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { @@ -316,6 +317,15 @@ defaultWebState, nonUserSpecificFieldsWeb, ); + } else if ( + action.type === identityLogInActionTypes.success && + action.payload.userID !== action.payload.preRequestUserState?.id + ) { + state = resetUserSpecificState( + state, + defaultWebState, + nonUserSpecificFieldsWeb, + ); } if (