Changeset View
Changeset View
Standalone View
Standalone View
web/settings/relationship/user-list.react.js
Show All 36 Lines | const searchResult = React.useMemo( | ||||
() => userStoreSearchIndex.getSearchResults(searchText), | () => userStoreSearchIndex.getSearchResults(searchText), | ||||
[searchText, userStoreSearchIndex], | [searchText, userStoreSearchIndex], | ||||
); | ); | ||||
const users = React.useMemo(() => { | const users = React.useMemo(() => { | ||||
const userIDs = searchText ? searchResult : Object.keys(userInfos); | const userIDs = searchText ? searchResult : Object.keys(userInfos); | ||||
const unfilteredUserInfos = []; | const unfilteredUserInfos = []; | ||||
for (const id of userIDs) { | for (const id of userIDs) { | ||||
const { username, avatar, relationshipStatus } = userInfos[id]; | const { username, relationshipStatus } = userInfos[id]; | ||||
if (!username) { | if (!username) { | ||||
continue; | continue; | ||||
} | } | ||||
unfilteredUserInfos.push({ | unfilteredUserInfos.push({ | ||||
id, | id, | ||||
username, | username, | ||||
avatar, | |||||
relationshipStatus, | relationshipStatus, | ||||
}); | }); | ||||
} | } | ||||
return unfilteredUserInfos.filter(filterUser).sort(usersComparator); | return unfilteredUserInfos.filter(filterUser).sort(usersComparator); | ||||
}, [filterUser, searchResult, searchText, userInfos, usersComparator]); | }, [filterUser, searchResult, searchText, userInfos, usersComparator]); | ||||
const usersWithENSNames = useENSNames<AccountUserInfo>(users); | const usersWithENSNames = useENSNames<AccountUserInfo>(users); | ||||
const userRows = React.useMemo(() => { | const userRows = React.useMemo(() => { | ||||
Show All 16 Lines |