diff --git a/web/settings/relationship/user-list-hooks.js b/web/settings/relationship/user-list-hooks.js index 8c6173397..fcadbd85e 100644 --- a/web/settings/relationship/user-list-hooks.js +++ b/web/settings/relationship/user-list-hooks.js @@ -1,25 +1,23 @@ // @flow import * as React from 'react'; import { useENSNames } from 'lib/hooks/ens-cache.js'; -import type { - AccountUserInfo, - GlobalAccountUserInfo, -} from 'lib/types/user-types'; +import { stringForUser } from 'lib/shared/user-utils.js'; -function useSortedENSResolvedUsers( - userInfos: $ReadOnlyArray, -): $ReadOnlyArray { +type BaseENSResolvedUser = { +username?: ?string, +isViewer?: ?boolean, ... }; +function useSortedENSResolvedUsers( + userInfos: $ReadOnlyArray, +): $ReadOnlyArray { const ensResolvedUsers = useENSNames(userInfos); return React.useMemo( () => ensResolvedUsers.sort((userInfo1, userInfo2) => - userInfo1.username.localeCompare(userInfo2.username), + stringForUser(userInfo1).localeCompare(stringForUser(userInfo2)), ), [ensResolvedUsers], ); } export { useSortedENSResolvedUsers };