diff --git a/native/chat/message-list-thread-search.react.js b/native/chat/message-list-thread-search.react.js --- a/native/chat/message-list-thread-search.react.js +++ b/native/chat/message-list-thread-search.react.js @@ -3,8 +3,10 @@ import * as React from 'react'; import { Text, View } from 'react-native'; +import { useProtocolSelection } from 'lib/contexts/protocol-selection-context.js'; import { useResolvableNames } from 'lib/hooks/names-cache.js'; import { extractFIDFromUserID } from 'lib/shared/id-utils.js'; +import { protocolNames } from 'lib/shared/protocol-names.js'; import { notFriendNotice } from 'lib/shared/search-utils.js'; import { useFindExistingUserForFid } from 'lib/shared/user-utils.js'; import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js'; @@ -65,6 +67,7 @@ const viewerID = useSelector(state => state.currentUserInfo?.id); const findExistingUserForFid = useFindExistingUserForFid(); + const { setSelectedProtocol } = useProtocolSelection(); const onUserSelect = React.useCallback( async (selectedUserInfo: AccountUserInfo) => { for (const existingUserInfo of userInfoInputArray) { @@ -77,6 +80,7 @@ let userInfo: AccountUserInfo = selectedUserInfo; if (isFarcasterOnlyUser) { userInfo = findExistingUserForFid(userInfo) ?? userInfo; + setSelectedProtocol(protocolNames.FARCASTER_DC); } if ( (!isFarcasterOnlyUser && nonFriends.has(userInfo.id)) || @@ -98,6 +102,7 @@ updateTagInput, findExistingUserForFid, resolveToUser, + setSelectedProtocol, ], ); diff --git a/web/chat/chat-thread-composer.react.js b/web/chat/chat-thread-composer.react.js --- a/web/chat/chat-thread-composer.react.js +++ b/web/chat/chat-thread-composer.react.js @@ -55,7 +55,7 @@ function ChatThreadComposer(props: Props): React.Node { const { userInfoInputArray, threadID, inputState } = props; - const { selectedProtocol } = useProtocolSelection(); + const { selectedProtocol, setSelectedProtocol } = useProtocolSelection(); const [usernameInputText, setUsernameInputText] = React.useState(''); @@ -121,6 +121,7 @@ let selectedUser: AccountUserInfo = user; if (isFarcasterOnlyUser) { selectedUser = findExistingUserForFid(user) ?? selectedUser; + setSelectedProtocol(protocolNames.FARCASTER_DC); } if ( ((!isFarcasterOnlyUser && notice === notFriendNotice) || @@ -165,6 +166,7 @@ existingThreadInfoFinderForCreatingThread, dispatch, pushModal, + setSelectedProtocol, ], );