Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3301689
D12216.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12216.id.diff
View Options
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -1004,6 +1004,8 @@
return { updates };
};
+const processNewUserIDsActionType = 'PROCESS_NEW_USER_IDS';
+
export {
changeKeyserverUserPasswordActionTypes,
changeKeyserverUserPassword,
@@ -1049,4 +1051,5 @@
useIdentityWalletRegister,
identityGenerateNonceActionTypes,
useIdentityGenerateNonce,
+ processNewUserIDsActionType,
};
diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js
--- a/lib/reducers/user-reducer.js
+++ b/lib/reducers/user-reducer.js
@@ -10,6 +10,7 @@
newThreadActionTypes,
} from '../actions/thread-actions.js';
import {
+ processNewUserIDsActionType,
identityLogInActionTypes,
identityRegisterActionTypes,
deleteAccountActionTypes,
@@ -200,7 +201,34 @@
$ReadOnlyArray<ClientUserInconsistencyReportCreationRequest>,
$ReadOnlyArray<UserStoreOperation>,
] {
- if (
+ if (action.type === processNewUserIDsActionType) {
+ const filteredUserIDs = action.payload.userIDs.filter(
+ id => !state.userInfos[id],
+ );
+ const newUserInfosArray = filteredUserIDs.map(id => ({
+ id,
+ username: null,
+ }));
+ const newUserInfos: UserInfos = _keyBy(userInfo => userInfo.id)(
+ newUserInfosArray,
+ );
+
+ const userStoreOps: $ReadOnlyArray<UserStoreOperation> =
+ convertUserInfosToReplaceUserOps(newUserInfos);
+ const processedUserInfos: UserInfos = processUserStoreOps(
+ state.userInfos,
+ userStoreOps,
+ );
+
+ return [
+ {
+ ...state,
+ userInfos: processedUserInfos,
+ },
+ [],
+ userStoreOps,
+ ];
+ } else if (
action.type === joinThreadActionTypes.success ||
action.type === newThreadActionTypes.success
) {
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -1441,6 +1441,13 @@
+error: true,
+payload: Error,
+loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'PROCESS_NEW_USER_IDS',
+ +payload: {
+ +userIDs: $ReadOnlyArray<string>,
+ },
+ +loadingInfo: LoadingInfo,
},
}>;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 3:25 AM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2536608
Default Alt Text
D12216.id.diff (2 KB)
Attached To
Mode
D12216: [lib] Create user infos for new user ids
Attached
Detach File
Event Timeline
Log In to Comment