Changeset View
Changeset View
Standalone View
Standalone View
native/chat/message-list-thread-search.react.js
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | const [userListItems, nonFriends] = React.useMemo(() => { | ||||
const userListItemsArr = []; | const userListItemsArr = []; | ||||
for (const searchResult of userSearchResults) { | for (const searchResult of userSearchResults) { | ||||
if (searchResult.notice !== notFriendNotice) { | if (searchResult.notice !== notFriendNotice) { | ||||
userListItemsArr.push(searchResult); | userListItemsArr.push(searchResult); | ||||
continue; | continue; | ||||
} | } | ||||
nonFriendsSet.add(searchResult.id); | nonFriendsSet.add(searchResult.id); | ||||
const { alertText, alertTitle, ...rest } = searchResult; | const { alert, ...rest } = searchResult; | ||||
userListItemsArr.push(rest); | userListItemsArr.push(rest); | ||||
} | } | ||||
return [userListItemsArr, nonFriendsSet]; | return [userListItemsArr, nonFriendsSet]; | ||||
}, [userSearchResults, userInfoInputArray]); | }, [userSearchResults, userInfoInputArray]); | ||||
const onUserSelect = React.useCallback( | const onUserSelect = React.useCallback( | ||||
(userID: string) => { | (userID: string) => { | ||||
for (const existingUserInfo of userInfoInputArray) { | for (const existingUserInfo of userInfoInputArray) { | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |