Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3495785
D12318.id41038.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12318.id41038.diff
View Options
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,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
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 9:58 AM (13 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681387
Default Alt Text
D12318.id41038.diff (1 KB)
Attached To
Mode
D12318: [lib] Don't remove avatar when fetching username
Attached
Detach File
Event Timeline
Log In to Comment