diff --git a/lib/selectors/keyserver-selectors.js b/lib/selectors/keyserver-selectors.js --- a/lib/selectors/keyserver-selectors.js +++ b/lib/selectors/keyserver-selectors.js @@ -99,14 +99,19 @@ for (const key in keyserverInfos) { const keyserverInfo = keyserverInfos[key]; - const keyserverAdminUsername = userInfos[key]?.username; + const keyserverAdminUserUsername = userInfos[key]?.username; - if (!keyserverAdminUsername) { + if (!keyserverAdminUserUsername) { continue; } + const keyserverAdminUserInfo = { + id: userInfos[key].id, + username: keyserverAdminUserUsername, + }; + result.push({ - keyserverAdminUsername, + keyserverAdminUserInfo, keyserverInfo, }); } diff --git a/lib/types/keyserver-types.js b/lib/types/keyserver-types.js --- a/lib/types/keyserver-types.js +++ b/lib/types/keyserver-types.js @@ -5,6 +5,7 @@ import type { PlatformDetails } from './device-types.js'; import { connectionInfoValidator } from './socket-types.js'; import type { ConnectionInfo } from './socket-types.js'; +import type { GlobalAccountUserInfo } from './user-types.js'; import { tShape, tPlatformDetails } from '../utils/validation-utils.js'; export type KeyserverInfo = { @@ -24,7 +25,7 @@ }; export type SelectedKeyserverInfo = { - +keyserverAdminUsername: string, + +keyserverAdminUserInfo: GlobalAccountUserInfo, +keyserverInfo: KeyserverInfo, }; diff --git a/native/profile/keyserver-selection-bottom-sheet.react.js b/native/profile/keyserver-selection-bottom-sheet.react.js --- a/native/profile/keyserver-selection-bottom-sheet.react.js +++ b/native/profile/keyserver-selection-bottom-sheet.react.js @@ -6,6 +6,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'; import type { KeyserverInfo } from 'lib/types/keyserver-types.js'; +import type { GlobalAccountUserInfo } from 'lib/types/user-types.js'; import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-provider.react.js'; import BottomSheet from '../bottom-sheet/bottom-sheet.react.js'; @@ -18,7 +19,7 @@ import { useColors, useStyles } from '../themes/colors.js'; export type KeyserverSelectionBottomSheetParams = { - +keyserverAdminUsername: string, + +keyserverAdminUserInfo: GlobalAccountUserInfo, +keyserverInfo: KeyserverInfo, }; @@ -31,7 +32,7 @@ const { navigation, route: { - params: { keyserverAdminUsername, keyserverInfo }, + params: { keyserverAdminUserInfo, keyserverInfo }, }, } = props; @@ -139,7 +140,7 @@ diff --git a/native/profile/keyserver-selection-list-item.react.js b/native/profile/keyserver-selection-list-item.react.js --- a/native/profile/keyserver-selection-list-item.react.js +++ b/native/profile/keyserver-selection-list-item.react.js @@ -5,6 +5,7 @@ import { TouchableOpacity } from 'react-native'; import type { KeyserverInfo } from 'lib/types/keyserver-types.js'; +import type { GlobalAccountUserInfo } from 'lib/types/user-types.js'; import CommIcon from '../components/comm-icon.react.js'; import Pill from '../components/pill.react.js'; @@ -13,12 +14,12 @@ import { useStyles, useColors } from '../themes/colors.js'; type Props = { - +keyserverAdminUsername: string, + +keyserverAdminUserInfo: GlobalAccountUserInfo, +keyserverInfo: KeyserverInfo, }; function KeyserverSelectionListItem(props: Props): React.Node { - const { keyserverAdminUsername, keyserverInfo } = props; + const { keyserverAdminUserInfo, keyserverInfo } = props; const styles = useStyles(unboundStyles); const colors = useColors(); @@ -29,11 +30,11 @@ navigate<'KeyserverSelectionBottomSheet'>({ name: KeyserverSelectionBottomSheetRouteName, params: { - keyserverAdminUsername, + keyserverAdminUserInfo, keyserverInfo, }, }); - }, [keyserverAdminUsername, keyserverInfo, navigate]); + }, [keyserverAdminUserInfo, keyserverInfo, navigate]); const cloudIcon = React.useMemo( () => ( @@ -53,7 +54,7 @@ onPress={onPress} > @@ -63,7 +64,7 @@ [ cloudIcon, colors.codeBackground, - keyserverAdminUsername, + keyserverAdminUserInfo.username, keyserverInfo.connection, onPress, styles.keyserverListItemContainer, diff --git a/native/profile/keyserver-selection-list.react.js b/native/profile/keyserver-selection-list.react.js --- a/native/profile/keyserver-selection-list.react.js +++ b/native/profile/keyserver-selection-list.react.js @@ -11,7 +11,7 @@ import { useStyles } from '../themes/colors.js'; function keyExtractor(item: SelectedKeyserverInfo) { - return `${item.keyserverAdminUsername}${item.keyserverInfo.urlPrefix}`; + return `${item.keyserverAdminUserInfo.id}${item.keyserverInfo.urlPrefix}`; } function renderKeyserverListItem({ item }) {