Page MenuHomePhorge

D11784.1765159033.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D11784.1765159033.diff

diff --git a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
--- a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
+++ b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel.react.js
@@ -7,9 +7,10 @@
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { NeynarClientContext } from 'lib/components/neynar-client-provider.react.js';
+import type { FarcasterChannel } from 'lib/types/farcaster-types.js';
import { useCurrentUserFID } from 'lib/utils/farcaster-utils.js';
-import type { TagFarcasterChannelNavigationProp } from './tag-farcaster-channel-navigator.react';
+import type { TagFarcasterChannelNavigationProp } from './tag-farcaster-channel-navigator.react.js';
import SWMansionIcon from '../../components/swmansion-icon.react.js';
import { type NavigationRoute } from '../../navigation/route-names.js';
import { useSelector } from '../../redux/redux-utils.js';
@@ -29,10 +30,11 @@
const fid = useCurrentUserFID();
invariant(fid, 'FID should be set');
- const [selectedChannel, setSelectedChannel] = React.useState<?string>(null);
+ const [selectedChannel, setSelectedChannel] =
+ React.useState<?FarcasterChannel>(null);
const [channelOptions, setChannelOptions] = React.useState<
- $ReadOnlyArray<string>,
+ $ReadOnlyArray<FarcasterChannel>,
>([]);
const neynarClientContext = React.useContext(NeynarClientContext);
@@ -42,11 +44,9 @@
React.useEffect(() => {
void (async () => {
- const data = await client.fetchFollowedFarcasterChannels(fid);
+ const channels = await client.fetchFollowedFarcasterChannels(fid);
- const result = data.map(channel => channel.name);
-
- setChannelOptions(result);
+ setChannelOptions(channels);
})();
}, [client, fid]);
@@ -72,8 +72,10 @@
);
const onPressSelectChannel = React.useCallback(() => {
+ const channelNames = channelOptions.map(channel => channel.name);
+
const options =
- Platform.OS === 'ios' ? [...channelOptions, 'Cancel'] : channelOptions;
+ Platform.OS === 'ios' ? [...channelNames, 'Cancel'] : channelNames;
const cancelButtonIndex = Platform.OS === 'ios' ? options.length - 1 : -1;
@@ -103,8 +105,8 @@
[styles.sectionContainer, styles.touchableSectionContainer],
);
- const channelSelectionTextContent = selectedChannel
- ? selectedChannel
+ const channelSelectionTextContent = selectedChannel?.name
+ ? selectedChannel.name
: 'No Farcaster channel tagged';
const tagFarcasterChannel = React.useMemo(

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 8, 1:57 AM (4 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5846764
Default Alt Text
D11784.1765159033.diff (2 KB)

Event Timeline