Don't do iOS-specific setup when not supported

Summary:
Now flipper will include iOS devices in the dropdown, but you'll also get a message saying they aren't yet supported.
Also doesn't start up the PortForwardingMacApp instances in this case, because it's pointless.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13319990

fbshipit-source-id: 75d72c6ed2478c7b999c5f43b764f097141b33de
This commit is contained in:
John Knox
2018-12-04 07:08:05 -08:00
committed by Facebook Github Bot
parent 3057c0a6e7
commit 606d689cae
3 changed files with 35 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ import type Client from '../Client';
import type {UninitializedClient} from '../UninitializedClient';
import {isEqual} from 'lodash';
import {RecurringError} from '../utils/errors';
import iosUtil from '../fb-stubs/iOSContainerUtility';
export type State = {|
devices: Array<BaseDevice>,
@@ -153,12 +154,20 @@ export default function reducer(
selection = {};
}
const error =
payload.os === 'iOS' &&
payload.deviceType === 'physical' &&
!iosUtil.isAvailable()
? 'iOS Devices are not yet supported'
: null;
return {
...state,
devices,
// select device if none was selected before
selectedDevice,
...selection,
error,
};
}
case 'UNREGISTER_DEVICES': {