Fix to avoid loading of disabled device plugins

Summary: There is a bug right now that even for disabled plugins we're loading them. In particular, this led to the Flipper freezes caused by Logs plugin even if it is disabled.

Reviewed By: passy

Differential Revision: D26503012

fbshipit-source-id: 2068626f4637ced44c457ee1b7ba7fffdcf5aa47
This commit is contained in:
Anton Nikolaev
2021-02-18 03:57:00 -08:00
committed by Facebook GitHub Bot
parent 805261b429
commit c0010bea4c
9 changed files with 32 additions and 9 deletions

View File

@@ -240,7 +240,10 @@ export default (store: Store, logger: Logger) => {
payload: new Set(reconnectedDevices),
});
androidDevice.loadDevicePlugins(store.getState().plugins.devicePlugins);
androidDevice.loadDevicePlugins(
store.getState().plugins.devicePlugins,
store.getState().connections.userStarredDevicePlugins,
);
store.dispatch({
type: 'REGISTER_DEVICE',
payload: androidDevice,

View File

@@ -22,7 +22,10 @@ export default (store: Store, _logger: Logger) => {
} else {
return;
}
device.loadDevicePlugins(store.getState().plugins.devicePlugins);
device.loadDevicePlugins(
store.getState().plugins.devicePlugins,
store.getState().connections.userStarredDevicePlugins,
);
store.dispatch({
type: 'REGISTER_DEVICE',
payload: device,

View File

@@ -134,7 +134,10 @@ function processDevices(
serial: udid,
});
const iOSDevice = new IOSDevice(udid, type, name);
iOSDevice.loadDevicePlugins(store.getState().plugins.devicePlugins);
iOSDevice.loadDevicePlugins(
store.getState().plugins.devicePlugins,
store.getState().connections.userStarredDevicePlugins,
);
store.dispatch({
type: 'REGISTER_DEVICE',
payload: iOSDevice,

View File

@@ -57,7 +57,10 @@ export async function registerMetroDevice(
name: metroDevice.title,
});
metroDevice.loadDevicePlugins(store.getState().plugins.devicePlugins);
metroDevice.loadDevicePlugins(
store.getState().plugins.devicePlugins,
store.getState().connections.userStarredDevicePlugins,
);
store.dispatch({
type: 'REGISTER_DEVICE',
payload: metroDevice,