Filter out OS devices when finding valid clients
Summary: When running debug builds, and not specifying a `device=...` qualifier as part of the deeplink, you'd get stuck on the "waiting for plugin to be launched" dialogue as Flipper would accept the local MacOS (or Windows, ...) connection as a valid client which can be quite confusing. Reviewed By: mweststrate Differential Revision: D31857737 fbshipit-source-id: ff568544f660c51e17b40c2aaadf058588746ef9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ece8b8e1a1
commit
ec9e3aeb6e
@@ -452,12 +452,17 @@ async function selectDevicesAndClient(
|
|||||||
): Promise<false | BaseDevice | Client> {
|
): Promise<false | BaseDevice | Client> {
|
||||||
function findValidDevices() {
|
function findValidDevices() {
|
||||||
// find connected devices with the right OS.
|
// find connected devices with the right OS.
|
||||||
return store
|
return (
|
||||||
.getState()
|
store
|
||||||
.connections.devices.filter((d) => d.connected.get())
|
.getState()
|
||||||
.filter(
|
.connections.devices.filter((d) => d.connected.get())
|
||||||
(d) => params.devices.length === 0 || params.devices.includes(d.os),
|
.filter(
|
||||||
);
|
(d) => params.devices.length === 0 || params.devices.includes(d.os),
|
||||||
|
)
|
||||||
|
// This filters out OS-level devices which are causing more confusion than good
|
||||||
|
// when used with deeplinks.
|
||||||
|
.filter(canBeDefaultDevice)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop until we have devices (or abort)
|
// loop until we have devices (or abort)
|
||||||
|
|||||||
Reference in New Issue
Block a user