Page MenuHomePhabricator

D5627.id20362.diff
No OneTemporary

D5627.id20362.diff

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

Mime Type
text/plain
Expires
Sun, Nov 24, 9:34 PM (20 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577377
Default Alt Text
D5627.id20362.diff (1 KB)

Event Timeline