diff --git a/lib/hooks/relationship-hooks.js b/lib/hooks/relationship-hooks.js --- a/lib/hooks/relationship-hooks.js +++ b/lib/hooks/relationship-hooks.js @@ -4,7 +4,7 @@ import uuid from 'uuid'; import { useNewThickThread } from './thread-hooks.js'; -import { useFindUserIdentities } from '../actions/find-user-identities-actions.js'; +import { useUsersSupportThickThreads } from './user-identities-hooks.js'; import { updateRelationships as serverUpdateRelationships } from '../actions/relationship-actions.js'; import { useLegacyAshoatKeyserverCall } from '../keyserver-conn/legacy-keyserver-call.js'; import { pendingToRealizedThreadIDsSelector } from '../selectors/thread-selectors.js'; @@ -87,7 +87,7 @@ ); const createNewThickThread = useNewThickThread(); - const findUserIdentities = useFindUserIdentities(); + const filterUsersSupportingThickThreads = useUsersSupportThickThreads(); const updateRelationshipsAndSendRobotext = React.useCallback( async (action: RelationshipAction, userIDs: $ReadOnlyArray) => { @@ -97,10 +97,11 @@ ); return {}; } - const { identities } = await findUserIdentities(userIDs); + const usersSupportingThickThreads = + await filterUsersSupportingThickThreads(userIDs); const planForUsers = new Map(); for (const userID of userIDs) { - if (!identities[userID]) { + if (!usersSupportingThickThreads.has(userID)) { planForUsers.set(userID, { plan: 'send_to_thin_thread' }); continue; } @@ -219,7 +220,7 @@ [ viewerID, updateRelationships, - findUserIdentities, + filterUsersSupportingThickThreads, pendingToRealizedThreadIDs, sendRobotextToThickThread, userInfos,