Page MenuHomePhabricator

D4306.diff
No OneTemporary

D4306.diff

diff --git a/web/settings/relationship/add-users-list.react.js b/web/settings/relationship/add-users-list.react.js
--- a/web/settings/relationship/add-users-list.react.js
+++ b/web/settings/relationship/add-users-list.react.js
@@ -4,6 +4,7 @@
import { searchUsers } from 'lib/actions/user-actions.js';
import { userStoreSearchIndex as userStoreSearchIndexSelector } from 'lib/selectors/user-selectors.js';
+import type { UserRelationshipStatus } from 'lib/types/relationship-types.js';
import type { GlobalAccountUserInfo } from 'lib/types/user-types.js';
import { useServerCall } from 'lib/utils/action-utils.js';
@@ -11,10 +12,11 @@
type Props = {
+searchText: string,
+ +excludedStatuses?: $ReadOnlySet<UserRelationshipStatus>,
};
function AddUsersList(props: Props): React.Node {
- const { searchText } = props;
+ const { searchText, excludedStatuses = new Set() } = props;
const userStoreSearchIndex = useSelector(userStoreSearchIndexSelector);
const [userStoreSearchResults, setUserStoreSearchResults] = React.useState<
@@ -73,8 +75,9 @@
() =>
Object.keys(mergedUserInfos)
.map(userID => mergedUserInfos[userID])
+ .filter(user => !excludedStatuses.has(user.relationshipStatus))
.sort((user1, user2) => user1.username.localeCompare(user2.username)),
- [mergedUserInfos],
+ [excludedStatuses, mergedUserInfos],
);
return null;

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 8:49 AM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676433
Default Alt Text
D4306.diff (1 KB)

Event Timeline