Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32156385
D15460.1765035900.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15460.1765035900.diff
View Options
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,
],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 3:45 PM (20 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5830296
Default Alt Text
D15460.1765035900.diff (2 KB)
Attached To
Mode
D15460: [web][native] default to Farcaster thread when selecting user based on Farcaster name
Attached
Detach File
Event Timeline
Log In to Comment