Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3529593
D9776.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
D9776.diff
View Options
diff --git a/web/modals/threads/thread-picker-modal.react.js b/web/modals/threads/thread-picker-modal.react.js
--- a/web/modals/threads/thread-picker-modal.react.js
+++ b/web/modals/threads/thread-picker-modal.react.js
@@ -2,7 +2,6 @@
import invariant from 'invariant';
import * as React from 'react';
-import { createSelector } from 'reselect';
import { useGlobalThreadSearchIndex } from 'lib/selectors/nav-selectors.js';
import { onScreenEntryEditableThreadInfos } from 'lib/selectors/thread-selectors.js';
@@ -81,26 +80,12 @@
[searchIndex],
);
- const listDataSelector = createSelector(
- state => state.onScreenThreadInfos,
- state => state.searchText,
- state => state.searchResults,
- (
- threadInfos: $ReadOnlyArray<ThreadInfo>,
- text: string,
- results: Set<string>,
- ) =>
- text
- ? threadInfos.filter(threadInfo => results.has(threadInfo.id))
- : [...threadInfos],
- );
-
- const threads = useSelector(() =>
- listDataSelector({
- onScreenThreadInfos,
- searchText,
- searchResults,
- }),
+ const threads = React.useMemo(
+ () =>
+ searchText
+ ? onScreenThreadInfos.filter(thread => searchResults.has(thread.id))
+ : onScreenThreadInfos,
+ [searchText, onScreenThreadInfos, searchResults],
);
const threadPickerContent = React.useMemo(() => {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:15 PM (12 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2703067
Default Alt Text
D9776.diff (1 KB)
Attached To
Mode
D9776: [Flow202][web][skip-ci] [10/x] Fix nonsensical use of selectors in ThreadPickerModal
Attached
Detach File
Event Timeline
Log In to Comment