Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3378785
D5627.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
D5627.diff
View Options
diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js
--- a/lib/selectors/thread-selectors.js
+++ b/lib/selectors/thread-selectors.js
@@ -36,6 +36,7 @@
threadPermissions,
threadTypes,
type SidebarInfo,
+ threadTypeIsCommunityRoot,
} from '../types/thread-types';
import { dateString, dateFromString } from '../utils/date-utils';
import { values } from '../utils/objects';
@@ -57,6 +58,23 @@
threadInfoFromRawThreadInfo,
);
+const communityThreadSelector: (
+ state: BaseAppState<*>,
+) => $ReadOnlyArray<ThreadInfo> = createSelector(
+ threadInfoSelector,
+ (threadInfos: { +[id: string]: ThreadInfo }) => {
+ const result = [];
+ for (const threadID in threadInfos) {
+ const threadInfo = threadInfos[threadID];
+ if (!threadTypeIsCommunityRoot(threadInfo.type)) {
+ continue;
+ }
+ result.push(threadInfo);
+ }
+ return result;
+ },
+);
+
const canBeOnScreenThreadInfos: (
state: BaseAppState<*>,
) => $ReadOnlyArray<ThreadInfo> = createSelector(
@@ -398,6 +416,7 @@
export {
ancestorThreadInfos,
threadInfoSelector,
+ communityThreadSelector,
onScreenThreadInfos,
onScreenEntryEditableThreadInfos,
entryInfoSelector,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 1:04 PM (21 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594057
Default Alt Text
D5627.diff (1 KB)
Attached To
Mode
D5627: [lib] Add a selector for community roots
Attached
Detach File
Event Timeline
Log In to Comment