Page MenuHomePhabricator

D4268.diff
No OneTemporary

D4268.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
@@ -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

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)

Event Timeline