Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398075
D11394.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11394.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11394: [lib][web][native] Handle idnentity login in reducers
Attached
Detach File
Event Timeline
Log In to Comment