Page MenuHomePhabricator

D5627.id18408.diff
No OneTemporary

D5627.id18408.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 communintyThreadSelector: (
+ 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,
+ communintyThreadSelector,
onScreenThreadInfos,
onScreenEntryEditableThreadInfos,
entryInfoSelector,

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:04 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577450
Default Alt Text
D5627.id18408.diff (1 KB)

Event Timeline