diff --git a/lib/selectors/nav-selectors.js b/lib/selectors/nav-selectors.js --- a/lib/selectors/nav-selectors.js +++ b/lib/selectors/nav-selectors.js @@ -18,6 +18,7 @@ } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseNavInfo } from '../types/nav-types.js'; import type { BaseAppState } from '../types/redux-types.js'; +import { threadTypeIsPrivate } from '../types/thread-types-enum.js'; import type { UserInfo } from '../types/user-types.js'; import { getConfig } from '../utils/config.js'; import { values } from '../utils/objects.js'; @@ -168,7 +169,10 @@ searchTextArray.push(threadInfo.description); } for (const member of threadInfo.members) { - if (!member.role || member.id === viewerID) { + if ( + !member.role || + (member.id === viewerID && !threadTypeIsPrivate(threadInfo.type)) + ) { continue; } const userInfo = userInfos[member.id]; diff --git a/lib/types/thread-types-enum.js b/lib/types/thread-types-enum.js --- a/lib/types/thread-types-enum.js +++ b/lib/types/thread-types-enum.js @@ -166,6 +166,11 @@ threadTypes.GENESIS_PERSONAL, ]); +export const privateThreadTypes: $ReadOnlyArray = Object.freeze([ + threadTypes.PRIVATE, + threadTypes.GENESIS_PRIVATE, +]); + export function threadTypeIsCommunityRoot(threadType: ThreadType): boolean { return communityThreadTypes.includes(threadType); } @@ -183,3 +188,7 @@ export function threadTypeIsPersonal(threadType: ThreadType): boolean { return personalThreadTypes.includes(threadType); } + +export function threadTypeIsPrivate(threadType: ThreadType): boolean { + return privateThreadTypes.includes(threadType); +}