Page MenuHomePhabricator

D12318.id40981.diff
No OneTemporary

D12318.id40981.diff

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
@@ -231,8 +231,7 @@
];
} else if (
action.type === joinThreadActionTypes.success ||
- action.type === newThreadActionTypes.success ||
- action.type === findUserIdentitiesActionTypes.success
+ action.type === newThreadActionTypes.success
) {
const newUserInfos: UserInfos = _keyBy(userInfo => userInfo.id)(
action.payload.userInfos,
@@ -245,6 +244,37 @@
userStoreOps,
);
+ if (!_isEqual(state.userInfos)(processedUserInfos)) {
+ return [
+ {
+ ...state,
+ userInfos: processedUserInfos,
+ },
+ [],
+ userStoreOps,
+ ];
+ }
+ } else if (action.type === findUserIdentitiesActionTypes.success) {
+ const newUserInfos = _keyBy(userInfo => userInfo.id)(
+ action.payload.userInfos,
+ );
+
+ for (const id in newUserInfos) {
+ if (state.userInfos[id]) {
+ newUserInfos[id] = {
+ ...state.userInfos[id],
+ username: newUserInfos[id].username,
+ };
+ }
+ }
+
+ const userStoreOps: $ReadOnlyArray<UserStoreOperation> =
+ convertUserInfosToReplaceUserOps(newUserInfos);
+ const processedUserInfos: UserInfos = processUserStoreOps(
+ state.userInfos,
+ userStoreOps,
+ );
+
if (!_isEqual(state.userInfos)(processedUserInfos)) {
return [
{

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:58 AM (14 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681386
Default Alt Text
D12318.id40981.diff (1 KB)

Event Timeline