Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3299731
D13461.id44540.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13461.id44540.diff
View Options
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<number> = 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);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:06 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535120
Default Alt Text
D13461.id44540.diff (1 KB)
Attached To
Mode
D13461: [lib] fix `useThreadSearchIndex` to avoid ignoring private thread
Attached
Detach File
Event Timeline
Log In to Comment