diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -19,7 +19,7 @@ import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js'; import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js'; import { usePreRequestUserState } from '../selectors/account-selectors.js'; -import { getForeignPeerDevices } from '../selectors/user-selectors.js'; +import { getForeignPeerDeviceIDs } from '../selectors/user-selectors.js'; import { getOneTimeKeyValuesFromBlob, getPrekeyValueFromBlob, @@ -265,7 +265,7 @@ const broadcastDeviceListUpdates = useBroadcastDeviceListUpdates(); const { broadcastEphemeralMessage } = usePeerToPeerCommunication(); - const foreignPeerDevices = useSelector(getForeignPeerDevices); + const foreignPeerDevices = useSelector(getForeignPeerDeviceIDs); const logOut = useLogOut(primaryDeviceLogOutOptions); return React.useCallback(async () => { diff --git a/lib/selectors/user-selectors.js b/lib/selectors/user-selectors.js --- a/lib/selectors/user-selectors.js +++ b/lib/selectors/user-selectors.js @@ -235,23 +235,23 @@ // Foreign Peer Devices are all devices of users we are aware of, // but not our own devices. -const getForeignPeerDevices: (state: BaseAppState<>) => $ReadOnlyArray = - createSelector( - (state: BaseAppState<>) => state.auxUserStore.auxUserInfos, - (state: BaseAppState<>) => - state.currentUserInfo && state.currentUserInfo.id, - ( - auxUserInfos: AuxUserInfos, - currentUserID: ?string, - ): $ReadOnlyArray => - entries(auxUserInfos) - .map(([userID, auxUserInfo]: [string, AuxUserInfo]) => - userID !== currentUserID && auxUserInfo.deviceList?.devices - ? auxUserInfo.deviceList.devices - : [], - ) - .flat(), - ); +const getForeignPeerDeviceIDs: ( + state: BaseAppState<>, +) => $ReadOnlyArray = createSelector( + (state: BaseAppState<>) => state.auxUserStore.auxUserInfos, + (state: BaseAppState<>) => state.currentUserInfo && state.currentUserInfo.id, + ( + auxUserInfos: AuxUserInfos, + currentUserID: ?string, + ): $ReadOnlyArray => + entries(auxUserInfos) + .map(([userID, auxUserInfo]: [string, AuxUserInfo]) => + userID !== currentUserID && auxUserInfo.deviceList?.devices + ? auxUserInfo.deviceList.devices + : [], + ) + .flat(), +); export type DeviceIDAndPlatformDetails = { +deviceID: string, @@ -339,7 +339,7 @@ savedEmojiAvatarSelectorForCurrentUser, getRelativeUserIDs, usersWithMissingDeviceListSelector, - getForeignPeerDevices, + getForeignPeerDeviceIDs, getOwnPeerDevices, getKeyserverDeviceID, getAllPeerDevices, diff --git a/lib/tunnelbroker/use-peer-to-peer-message-handler.js b/lib/tunnelbroker/use-peer-to-peer-message-handler.js --- a/lib/tunnelbroker/use-peer-to-peer-message-handler.js +++ b/lib/tunnelbroker/use-peer-to-peer-message-handler.js @@ -16,7 +16,7 @@ } from '../hooks/peer-list-hooks.js'; import { getAllPeerDevices, - getForeignPeerDevices, + getForeignPeerDeviceIDs, } from '../selectors/user-selectors.js'; import { verifyAndGetDeviceList, @@ -180,7 +180,7 @@ invariant(identityContext, 'Identity context should be set'); const { identityClient, getAuthMetadata } = identityContext; - const foreignPeerDevices = useSelector(getForeignPeerDevices); + const foreignPeerDevices = useSelector(getForeignPeerDeviceIDs); const broadcastDeviceListUpdates = useBroadcastDeviceListUpdates(); const getAndUpdateDeviceListsForUsers = useGetAndUpdateDeviceListsForUsers(); diff --git a/native/profile/secondary-device-qr-code-scanner.react.js b/native/profile/secondary-device-qr-code-scanner.react.js --- a/native/profile/secondary-device-qr-code-scanner.react.js +++ b/native/profile/secondary-device-qr-code-scanner.react.js @@ -11,7 +11,7 @@ useBroadcastDeviceListUpdates, useGetAndUpdateDeviceListsForUsers, } from 'lib/hooks/peer-list-hooks.js'; -import { getForeignPeerDevices } from 'lib/selectors/user-selectors.js'; +import { getForeignPeerDeviceIDs } from 'lib/selectors/user-selectors.js'; import { addDeviceToDeviceList } from 'lib/shared/device-list-utils.js'; import { IdentityClientContext } from 'lib/shared/identity-client-context.js'; import { useTunnelbroker } from 'lib/tunnelbroker/tunnelbroker-context.js'; @@ -73,7 +73,7 @@ const broadcastDeviceListUpdates = useBroadcastDeviceListUpdates(); const getAndUpdateDeviceListsForUsers = useGetAndUpdateDeviceListsForUsers(); - const foreignPeerDevices = useSelector(getForeignPeerDevices); + const foreignPeerDevices = useSelector(getForeignPeerDeviceIDs); const { panelForegroundTertiaryLabel } = useColors();