From 2a3b9c9e43cfd5c23669bba0d2fabcd1f39c9003 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Thu, 1 Jul 2021 06:22:57 -0700 Subject: [PATCH] Fixed a bug with React Native plugins loading Summary: Fixed bug with "Hermes Debugger" and "React Dev Tools" plugin loading reported on GitHub: https://github.com/facebook/flipper/issues/2545. Changelog: Fixed bug with React Native plugins not loaded: Hermes Debugger, React Dev Tools etc. Reviewed By: mweststrate Differential Revision: D29516394 fbshipit-source-id: 4620e3d2b49ca2a1d3a5b2dd76d40d4667a0980b --- desktop/app/src/selectors/connections.tsx | 6 +++--- desktop/app/src/utils/pluginUtils.tsx | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/desktop/app/src/selectors/connections.tsx b/desktop/app/src/selectors/connections.tsx index 0cf6b8997..2f4ca25f1 100644 --- a/desktop/app/src/selectors/connections.tsx +++ b/desktop/app/src/selectors/connections.tsx @@ -36,9 +36,9 @@ export const getActiveClient = createSelector( export const getMetroDevice = createSelector(getDevices, (devices) => { return ( - (devices.find( - (device) => device.os === 'Metro' && !device.isArchived, - ) as MetroDevice) ?? null + (devices.find((device) => device.os === 'Metro' && !device.isArchived) as + | MetroDevice + | undefined) ?? null ); }); diff --git a/desktop/app/src/utils/pluginUtils.tsx b/desktop/app/src/utils/pluginUtils.tsx index 6416948e6..7418839fa 100644 --- a/desktop/app/src/utils/pluginUtils.tsx +++ b/desktop/app/src/utils/pluginUtils.tsx @@ -370,6 +370,7 @@ function getFavoritePlugins( export function computeActivePluginList({ enabledPlugins, devicePlugins, + metroPlugins, disabledPlugins, downloadablePlugins, unavailablePlugins, @@ -389,6 +390,13 @@ export function computeActivePluginList({ definition: plugin, }; } + for (const plugin of metroPlugins) { + pluginList[plugin.id] = { + status: 'enabled', + details: plugin.details, + definition: plugin, + }; + } for (const plugin of disabledPlugins) { pluginList[plugin.id] = { status: 'disabled',