Automatically select plugin after auto-update

Summary: Select reloaded plugin automatically

Reviewed By: mweststrate

Differential Revision: D23987545

fbshipit-source-id: bf54ca54e4aa46b987d57e76fbc4f3e9e5fc336e
This commit is contained in:
Anton Nikolaev
2020-09-29 04:25:01 -07:00
committed by Facebook GitHub Bot
parent b3ca84fc1b
commit bc39e72fd9
2 changed files with 9 additions and 2 deletions

View File

@@ -9,7 +9,6 @@
import { import {
PluginDefinition, PluginDefinition,
ClientPluginDefinition,
isSandyPlugin, isSandyPlugin,
FlipperPlugin, FlipperPlugin,
FlipperDevicePlugin, FlipperDevicePlugin,

View File

@@ -246,7 +246,15 @@ export default (state: State = INITAL_STATE, action: Actions): State => {
} }
} }
} }
if (!selectDevice) { if (!selectedDevice && selectedPlugin) {
const selectedClient = state.clients.find((c) =>
c.supportsPlugin(selectedPlugin),
);
selectedDevice = state.devices.find(
(v) => v.serial === selectedClient?.query.device_id,
);
}
if (!selectedDevice) {
console.warn('Trying to select a plugin before a device was selected!'); console.warn('Trying to select a plugin before a device was selected!');
} }
if (selectedPlugin) { if (selectedPlugin) {