Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32188458
D15283.1765089389.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15283.1765089389.diff
View Options
diff --git a/lib/shared/farcaster/farcaster-hooks.js b/lib/shared/farcaster/farcaster-hooks.js
--- a/lib/shared/farcaster/farcaster-hooks.js
+++ b/lib/shared/farcaster/farcaster-hooks.js
@@ -44,6 +44,7 @@
function useFetchConversation(): (
conversationID: string,
) => Promise<?FarcasterConversation> {
+ const fetchUsersByFIDs = useGetCommFCUsersForFIDs();
const fetchFarcasterConversation = useFetchFarcasterConversation();
const dispatch = useDispatch();
@@ -59,7 +60,29 @@
}
const farcasterConversation = conversationResult.result.conversation;
- const thread = createFarcasterRawThreadInfo(farcasterConversation);
+ let thread = createFarcasterRawThreadInfo(farcasterConversation);
+ const fids = thread.members.map(member => member.id);
+ const commFCUsersForFIDs = await fetchUsersByFIDs(fids);
+ const threadMembers = thread.members.map(member => ({
+ ...member,
+ id:
+ commFCUsersForFIDs.get(member.id)?.userID ??
+ userIDFromFID(member.id),
+ }));
+
+ thread = {
+ ...thread,
+ members: threadMembers,
+ };
+
+ if (threadMembers.length > 0) {
+ const newUserIDs = threadMembers.map(member => member.id);
+ dispatch({
+ type: processNewUserIDsActionType,
+ payload: { userIDs: newUserIDs },
+ });
+ }
+
const update = {
type: updateTypes.JOIN_THREAD,
id: uuid.v4(),
@@ -84,7 +107,7 @@
return null;
}
},
- [fetchFarcasterConversation, dispatch],
+ [fetchFarcasterConversation, fetchUsersByFIDs, dispatch],
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 6:36 AM (13 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5842900
Default Alt Text
D15283.1765089389.diff (1 KB)
Attached To
Mode
D15283: [lib] use Comm user IDs in `useFetchConversation`
Attached
Detach File
Event Timeline
Log In to Comment