Page MenuHomePhabricator

D11394.diff
No OneTemporary

D11394.diff

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 {
@@ -319,6 +320,15 @@
defaultWebState,
nonUserSpecificFieldsWeb,
);
+ } else if (
+ action.type === identityLogInActionTypes.success &&
+ action.payload.userID !== action.payload.preRequestUserState?.id
+ ) {
+ state = resetUserSpecificState(
+ state,
+ defaultWebState,
+ nonUserSpecificFieldsWeb,
+ );
}
if (action.type !== updateNavInfoActionType) {

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 8:41 PM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2608905
Default Alt Text
D11394.diff (3 KB)

Event Timeline