Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3246954
D9826.id33238.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D9826.id33238.diff
View Options
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
@@ -105,8 +105,13 @@
continue;
}
+ const keyserverAdminUserInfo = {
+ id: userInfos[key].id,
+ username: keyserverAdminUsername,
+ };
+
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,
};
@@ -34,7 +35,7 @@
const {
navigation,
route: {
- params: { keyserverAdminUsername, keyserverInfo },
+ params: { keyserverAdminUserInfo, keyserverInfo },
},
} = props;
@@ -140,7 +141,7 @@
<View style={styles.keyserverDetailsContainer}>
<View style={styles.keyserverHeaderContainer}>
<Pill
- label={keyserverAdminUsername}
+ label={keyserverAdminUserInfo.username}
backgroundColor={colors.codeBackground}
icon={cloudIcon}
/>
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}
>
<Pill
- label={keyserverAdminUsername}
+ label={keyserverAdminUserInfo.username}
backgroundColor={colors.codeBackground}
icon={cloudIcon}
/>
@@ -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 }) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 2:38 AM (20 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2495906
Default Alt Text
D9826.id33238.diff (5 KB)
Attached To
Mode
D9826: [lib/native] extend keyserverAdminUsername to be keyserverAdminUserInfo
Attached
Detach File
Event Timeline
Log In to Comment