Page MenuHomePhabricator

D9776.diff
No OneTemporary

D9776.diff

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

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)

Event Timeline