Page MenuHomePhabricator

D5627.diff
No OneTemporary

D5627.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
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)

Event Timeline