Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3493397
D4268.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
D4268.diff
View Options
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
@@ -2,7 +2,10 @@
import * as React from 'react';
+import { searchUsers } from 'lib/actions/user-actions.js';
import { userStoreSearchIndex as userStoreSearchIndexSelector } from 'lib/selectors/user-selectors.js';
+import type { GlobalAccountUserInfo } from 'lib/types/user-types.js';
+import { useServerCall } from 'lib/utils/action-utils.js';
import { useSelector } from '../../redux/redux-utils.js';
@@ -24,6 +27,22 @@
);
}, [searchText, userStoreSearchIndex]);
+ // eslint-disable-next-line no-unused-vars
+ const [serverSearchResults, setServerSearchResults] = React.useState<
+ $ReadOnlyArray<GlobalAccountUserInfo>,
+ >([]);
+ const callSearchUsers = useServerCall(searchUsers);
+ React.useEffect(() => {
+ (async () => {
+ if (searchText.length === 0) {
+ setServerSearchResults([]);
+ } else {
+ const { userInfos } = await callSearchUsers(searchText);
+ setServerSearchResults(userInfos);
+ }
+ })();
+ }, [callSearchUsers, searchText]);
+
return null;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 3:16 AM (19 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676425
Default Alt Text
D4268.diff (1 KB)
Attached To
Mode
D4268: [web] Search for the users on server
Attached
Detach File
Event Timeline
Log In to Comment