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 @@ -43,7 +43,6 @@ const searchTextPresent = searchText.length > 0; const userInfos = useSelector(state => state.userStore.userInfos); - // eslint-disable-next-line no-unused-vars const mergedUserInfos = React.useMemo(() => { const mergedInfos = {}; @@ -69,6 +68,17 @@ userStoreSearchResults, ]); + // eslint-disable-next-line no-unused-vars + const sortedUsers = React.useMemo(() => { + const users = []; + for (const userID in mergedUserInfos) { + users.push(mergedUserInfos[userID]); + } + return users.sort((user1, user2) => + user1.username.localeCompare(user2.username), + ); + }, [mergedUserInfos]); + return null; }