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 @@ -168,6 +168,18 @@ state.dataLoaded ); +const isLoggedInToKeyserver: ( + keyserverID: string, +) => (state: BaseAppState<>) => boolean = _memoize( + (keyserverID: string) => (state: BaseAppState<>) => { + if (!isLoggedIn(state)) { + return false; + } + const cookie = state.keyserverStore.keyserverInfos[keyserverID]?.cookie; + return !!cookie && cookie.startsWith('user='); + }, +); + const usersWithPersonalThreadSelector: ( state: BaseAppState<>, ) => $ReadOnlySet = createSelector( @@ -214,6 +226,7 @@ relativeMemberInfoSelectorForMembersOfThread, userInfoSelectorForPotentialMembers, isLoggedIn, + isLoggedInToKeyserver, usersWithPersonalThreadSelector, savedEmojiAvatarSelectorForCurrentUser, };