Add instrumentation, fix typo
Summary: - plugns -> plugins - Report platform failures from second invocation. Reviewed By: jknoxville Differential Revision: D17787179 fbshipit-source-id: 041325f572dd839bd268612269f3774518a409b2
This commit is contained in:
committed by
Facebook Github Bot
parent
4d1e7dc80f
commit
8f719b17e3
@@ -261,13 +261,16 @@ function useNPMSearch(
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reportUsage(`${TAG}:open`);
|
reportUsage(`${TAG}:open`);
|
||||||
reportPlatformFailures(
|
reportPlatformFailures(
|
||||||
getInstalledPlugns(),
|
getInstalledPlugins(),
|
||||||
`${TAG}:getInstalledPlugins`,
|
`${TAG}:getInstalledPlugins`,
|
||||||
).then(setInstalledPlugins);
|
).then(setInstalledPlugins);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onInstall = useCallback(async () => {
|
const onInstall = useCallback(async () => {
|
||||||
setInstalledPlugins(await getInstalledPlugns());
|
reportPlatformFailures(
|
||||||
|
getInstalledPlugins(),
|
||||||
|
`${TAG}:getInstalledPlugins`,
|
||||||
|
).then(setInstalledPlugins);
|
||||||
setRestartRequired(true);
|
setRestartRequired(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -333,7 +336,7 @@ function useNPMSearch(
|
|||||||
return List(results.map(createRow));
|
return List(results.map(createRow));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getInstalledPlugns() {
|
async function getInstalledPlugins() {
|
||||||
const dirs = await fs.readdir(PLUGIN_DIR);
|
const dirs = await fs.readdir(PLUGIN_DIR);
|
||||||
const plugins = await Promise.all<[string, PluginDefinition]>(
|
const plugins = await Promise.all<[string, PluginDefinition]>(
|
||||||
dirs.map(
|
dirs.map(
|
||||||
|
|||||||
Reference in New Issue
Block a user