Page MenuHomePhabricator

D11049.id37019.diff
No OneTemporary

D11049.id37019.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
@@ -371,6 +371,11 @@
return usernameToSearch;
}
+const searchIdentityUsersActionTypes = Object.freeze({
+ started: 'SEARCH_USERS_STARTED',
+ success: 'SEARCH_USERS_SUCCESS',
+ failed: 'SEARCH_USERS_FAILED',
+});
function useSearchIdentityUsers(
usernameInputText: string,
): $ReadOnlyArray<User> {
@@ -385,13 +390,14 @@
const forwardLookupSearchText = useForwardLookupSearchText(usernameInputText);
+ const dispatchActionPromise = useDispatchActionPromise();
React.useEffect(() => {
if (forwardLookupSearchText.length === 0) {
setSearchResults([]);
return;
}
- void (async () => {
+ const searchIdentityUsersPromise = (async () => {
try {
const result = await sendPrefixQuery(forwardLookupSearchText);
setSearchResults(
@@ -402,7 +408,16 @@
setSearchResults([]);
}
})();
- }, [currentUserID, forwardLookupSearchText, sendPrefixQuery]);
+ void dispatchActionPromise(
+ searchIdentityUsersActionTypes,
+ searchIdentityUsersPromise,
+ );
+ }, [
+ currentUserID,
+ forwardLookupSearchText,
+ dispatchActionPromise,
+ sendPrefixQuery,
+ ]);
return searchResults;
}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 9:12 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594931
Default Alt Text
D11049.id37019.diff (1 KB)

Event Timeline