Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3385443
D13821.id45471.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
D13821.id45471.diff
View Options
diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js
--- a/lib/selectors/chat-selectors.js
+++ b/lib/selectors/chat-selectors.js
@@ -214,38 +214,22 @@
return React.useMemo(
() =>
- getChatThreadItems(
- threadInfos,
- messageStore,
- messageInfos,
- sidebarInfos,
- filterFunction,
- ),
+ _flow(
+ _filter(filterFunction),
+ _map((threadInfo: ThreadInfo): ChatThreadItem =>
+ createChatThreadItem(
+ threadInfo,
+ messageStore,
+ messageInfos,
+ sidebarInfos[threadInfo.id],
+ ),
+ ),
+ _orderBy('lastUpdatedTimeIncludingSidebars')('desc'),
+ )(threadInfos),
[messageInfos, messageStore, sidebarInfos, filterFunction, threadInfos],
);
}
-function getChatThreadItems(
- threadInfos: { +[id: string]: ThreadInfo },
- messageStore: MessageStore,
- messageInfos: { +[id: string]: ?MessageInfo },
- sidebarInfos: { +[id: string]: $ReadOnlyArray<SidebarInfo> },
- filterFunction: (threadInfo: ?(ThreadInfo | RawThreadInfo)) => boolean,
-): $ReadOnlyArray<ChatThreadItem> {
- return _flow(
- _filter(filterFunction),
- _map((threadInfo: ThreadInfo): ChatThreadItem =>
- createChatThreadItem(
- threadInfo,
- messageStore,
- messageInfos,
- sidebarInfos[threadInfo.id],
- ),
- ),
- _orderBy('lastUpdatedTimeIncludingSidebars')('desc'),
- )(threadInfos);
-}
-
export type RobotextChatMessageInfoItem = {
+itemType: 'message',
+messageInfoType: 'robotext',
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 12:23 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598785
Default Alt Text
D13821.id45471.diff (1 KB)
Attached To
Mode
D13821: [lib] Inline getChatThreadItems
Attached
Detach File
Event Timeline
Log In to Comment