diff --git a/src/chrome/PluginInstaller.tsx b/src/chrome/PluginInstaller.tsx index da89506fe..022a4fa9a 100644 --- a/src/chrome/PluginInstaller.tsx +++ b/src/chrome/PluginInstaller.tsx @@ -126,8 +126,7 @@ const PluginInstaller = function props(props: Props) { query, setQuery, props.searchIndexFactory, - // TODO(T56693735): Refactor this to directly take props. - async () => props.installedPlugins, + props.installedPlugins, props.refreshInstalledPlugins, ); const restartApp = useCallback(() => { @@ -294,28 +293,17 @@ function useNPMSearch( query: string, setQuery: (query: string) => void, searchClientFactory: () => algoliasearch.Index, - getInstalledPlugins: () => Promise>, + installedPlugins: Map, refreshInstalledPlugins: () => void, ): TableRows_immutable { const index = useMemo(searchClientFactory, []); - const [installedPlugins, setInstalledPlugins] = useState( - new Map(), - ); - - const getAndSetInstalledPlugins = () => - reportPlatformFailures( - getInstalledPlugins(), - `${TAG}:getInstalledPlugins`, - ).then(setInstalledPlugins); useEffect(() => { reportUsage(`${TAG}:open`); - getAndSetInstalledPlugins(); }, []); const onInstall = useCallback(async () => { refreshInstalledPlugins(); - getAndSetInstalledPlugins(); setRestartRequired(true); }, []);