Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3281925
D12328.id41682.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
982 B
Referenced Files
None
Subscribers
None
D12328.id41682.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
@@ -272,6 +272,9 @@
const filteredUserIDs = action.payload.userIDs.filter(
id => !state.userInfos[id],
);
+ if (filteredUserIDs.length === 0) {
+ return [state, [], []];
+ }
const newUserInfosArray = filteredUserIDs.map(id => ({
id,
username: null,
@@ -286,15 +289,16 @@
state.userInfos,
userStoreOps,
);
-
- return [
- {
- ...state,
- userInfos: processedUserInfos,
- },
- [],
- userStoreOps,
- ];
+ if (!_isEqual(state.userInfos)(processedUserInfos)) {
+ return [
+ {
+ ...state,
+ userInfos: processedUserInfos,
+ },
+ [],
+ userStoreOps,
+ ];
+ }
} else if (
action.type === joinThreadActionTypes.success ||
action.type === newThreadActionTypes.success
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 10:23 AM (19 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2522257
Default Alt Text
D12328.id41682.diff (982 B)
Attached To
Mode
D12328: [lib] Avoid unnecessary state change in user reducer
Attached
Detach File
Event Timeline
Log In to Comment