Page MenuHomePhabricator

D5159.diff
No OneTemporary

D5159.diff

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

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)

Event Timeline