Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3487081
D3598.id10957.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
D3598.id10957.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
@@ -221,6 +221,12 @@
);
function useFlattenedChatListData(): $ReadOnlyArray<ChatThreadItem> {
+ return useFilteredChatListData(threadInChatList);
+}
+
+function useFilteredChatListData(
+ filterFunction: (threadInfo: ?(ThreadInfo | RawThreadInfo)) => boolean,
+): $ReadOnlyArray<ChatThreadItem> {
const threadInfos = useSelector(threadInfoSelector);
const messageInfos = useSelector(messageInfoSelector);
const sidebarInfos = useSelector(sidebarInfoSelector);
@@ -233,9 +239,9 @@
messageStore,
messageInfos,
sidebarInfos,
- threadInChatList,
+ filterFunction,
),
- [messageInfos, messageStore, sidebarInfos, threadInfos],
+ [messageInfos, messageStore, sidebarInfos, filterFunction, threadInfos],
);
}
@@ -491,5 +497,6 @@
createChatMessageItems,
messageListData,
useFlattenedChatListData,
+ useFilteredChatListData,
useMessageListData,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 6:49 AM (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675266
Default Alt Text
D3598.id10957.diff (1 KB)
Attached To
Mode
D3598: [lib] Introduce `useFilteredChatListData` hook
Attached
Detach File
Event Timeline
Log In to Comment