Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3528025
D5159.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
D5159.diff
View Options
diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js
--- a/lib/shared/search-utils.js
+++ b/lib/shared/search-utils.js
@@ -97,25 +97,28 @@
const nonFriends = [];
const blockedUsers = [];
- const friendsAndContainingThreadMembers = [];
+ const friends = [];
+ const containingThreadMembers = [];
+ const parentThreadMembers = [];
for (const userResult of results) {
const relationshipStatus = userResult.relationshipStatus;
- if (
- userResult.isMemberOfContainingThread &&
- !blockedRelationshipsStatuses.has(relationshipStatus)
- ) {
- friendsAndContainingThreadMembers.unshift(userResult);
- } else if (relationshipStatus === userRelationshipStatus.FRIEND) {
- friendsAndContainingThreadMembers.push(userResult);
- } else if (blockedRelationshipsStatuses.has(relationshipStatus)) {
+ if (blockedRelationshipsStatuses.has(relationshipStatus)) {
blockedUsers.push(userResult);
+ } else if (userResult.isMemberOfParentThread) {
+ parentThreadMembers.push(userResult);
+ } else if (userResult.isMemberOfContainingThread) {
+ containingThreadMembers.push(userResult);
+ } else if (relationshipStatus === userRelationshipStatus.FRIEND) {
+ friends.push(userResult);
} else {
nonFriends.push(userResult);
}
}
- const sortedResults = friendsAndContainingThreadMembers
+ const sortedResults = parentThreadMembers
+ .concat(containingThreadMembers)
+ .concat(friends)
.concat(nonFriends)
.concat(blockedUsers);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:00 AM (11 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701976
Default Alt Text
D5159.diff (1 KB)
Attached To
Mode
D5159: [lib] Show parent thread members before community members
Attached
Detach File
Event Timeline
Log In to Comment