Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3498182
D12318.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.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
@@ -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
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 9:00 PM (14 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681376
Default Alt Text
D12318.diff (1 KB)
Attached To
Mode
D12318: [lib] Don't remove avatar when fetching username
Attached
Detach File
Event Timeline
Log In to Comment