Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3386203
D8526.id28770.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
D8526.id28770.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
@@ -200,6 +200,27 @@
},
);
+const containedThreadInfos: (state: BaseAppState<*>) => {
+ +[id: string]: $ReadOnlyArray<ThreadInfo>,
+} = createSelector(
+ threadInfoSelector,
+ (threadInfos: { +[id: string]: ThreadInfo }) => {
+ const result = {};
+ for (const id in threadInfos) {
+ const threadInfo = threadInfos[id];
+ const containingThreadID = threadInfo.containingThreadID;
+ if (containingThreadID === null || containingThreadID === undefined) {
+ continue;
+ }
+ if (result[containingThreadID] === undefined) {
+ result[containingThreadID] = [];
+ }
+ result[containingThreadID].push(threadInfo);
+ }
+ return result;
+ },
+);
+
function getMostRecentRawMessageInfo(
threadInfo: ThreadInfo,
messageStore: MessageStore,
@@ -453,6 +474,7 @@
entryInfoSelector,
currentDaysToEntries,
childThreadInfos,
+ containedThreadInfos,
unreadCount,
unreadBackgroundCount,
otherUsersButNoOtherAdmins,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 3:43 AM (22 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599407
Default Alt Text
D8526.id28770.diff (1 KB)
Attached To
Mode
D8526: [lib] Add containedThreadInfos selector
Attached
Detach File
Event Timeline
Log In to Comment