Page MenuHomePhabricator

D12318.id41680.diff
No OneTemporary

D12318.id41680.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
@@ -297,8 +297,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,
@@ -311,6 +310,35 @@
userStoreOps,
);
+ if (!_isEqual(state.userInfos)(processedUserInfos)) {
+ return [
+ {
+ ...state,
+ userInfos: processedUserInfos,
+ },
+ [],
+ userStoreOps,
+ ];
+ }
+ } else if (action.type === findUserIdentitiesActionTypes.success) {
+ const newUserInfos = action.payload.userInfos.reduce(
+ (acc, userInfo) => ({
+ ...acc,
+ [userInfo.id]: {
+ ...state.userInfos[userInfo.id],
+ username: userInfo.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, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681376
Default Alt Text
D12318.id41680.diff (1 KB)

Event Timeline