diff --git a/lib/handlers/user-infos-handler.react.js b/lib/handlers/user-infos-handler.react.js --- a/lib/handlers/user-infos-handler.react.js +++ b/lib/handlers/user-infos-handler.react.js @@ -12,9 +12,11 @@ } from '../actions/user-actions.js'; import { useGetAndUpdateDeviceListsForUsers } from '../hooks/peer-list-hooks.js'; import { useLegacyAshoatKeyserverCall } from '../keyserver-conn/legacy-keyserver-call.js'; +import { cookieSelector } from '../selectors/keyserver-selectors.js'; import { usersWithMissingDeviceListSelector } from '../selectors/user-selectors.js'; import { useTunnelbroker } from '../tunnelbroker/tunnelbroker-context.js'; import { relationshipActions } from '../types/relationship-types.js'; +import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; import { getMessageForException } from '../utils/errors.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; import { useSelector } from '../utils/redux-utils.js'; @@ -43,7 +45,15 @@ const currentUserInfo = useSelector(state => state.currentUserInfo); + const cookie = useSelector(cookieSelector(authoritativeKeyserverID())); + const hasUserCookie = !!(cookie && cookie.startsWith('user=')); + const currentUserID = useSelector(state => state.currentUserInfo?.id); + const loggedInToAuthKeyserver = !!currentUserID && hasUserCookie; + React.useEffect(() => { + if (!loggedInToAuthKeyserver) { + return; + } const newUserIDs = Object.keys(userInfosWithMissingUsernames).filter( id => !requestedIDsRef.current.has(id), ); @@ -89,6 +99,7 @@ findUserIdentities, userInfos, userInfosWithMissingUsernames, + loggedInToAuthKeyserver, ]); const usersWithMissingDeviceList = useSelector(