Page MenuHomePhabricator

D13461.diff
No OneTemporary

D13461.diff

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

Mime Type
text/plain
Expires
Mon, Sep 30, 7:31 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2206632
Default Alt Text
D13461.diff (1 KB)

Event Timeline