Back out "JS apps support 1/n"

Summary:
Original commit changeset: 56d1ca1a60ed

This broke Android support in some instances. We haven't had a chance to investigate this yet, but this should cleanly reapply, so we can figure out what happened after the release.

Reviewed By: cekkaewnumchai

Differential Revision: D18688590

fbshipit-source-id: ff84080d43fa481cc8c8c669a76aed15d0f8aa56
This commit is contained in:
John Knox
2019-11-25 09:53:16 -08:00
committed by realpassy
parent e50f900758
commit 2fd6301876
10 changed files with 10 additions and 496 deletions

View File

@@ -12,17 +12,11 @@ import {connect, ReactReduxContext} from 'react-redux';
import {spawn} from 'child_process';
import {dirname} from 'path';
import {selectDevice, preferDevice} from '../reducers/connections';
import {
setActiveSheet,
ActiveSheet,
ACTIVE_SHEET_JS_EMULATOR_LAUNCHER,
} from '../reducers/application';
import {default as which} from 'which';
import {showOpenDialog} from '../utils/exportData';
import BaseDevice from '../devices/BaseDevice';
import React, {Component} from 'react';
import {State} from '../reducers';
import GK from '../fb-stubs/GK';
type StateFromProps = {
selectedDevice: BaseDevice | null | undefined;
@@ -33,7 +27,6 @@ type StateFromProps = {
type DispatchFromProps = {
selectDevice: (device: BaseDevice) => void;
preferDevice: (device: string) => void;
setActiveSheet: (sheet: ActiveSheet) => void;
};
type OwnProps = {};
@@ -161,30 +154,17 @@ class DevicesButton extends Component<Props> {
label: name,
click: () => this.launchEmulator(name),
}));
// Launch JS emulator
if (GK.get('flipper_js_client_emulator')) {
if (emulators.length > 0) {
dropdown.push(
{type: 'separator' as 'separator'},
{
label: 'Launch Android emulators',
enabled: false,
},
...emulators,
);
}
if (emulators.length > 0) {
dropdown.push(
{type: 'separator' as 'separator'},
{
label: 'Launch JS Web App',
click: () =>
this.props.setActiveSheet(ACTIVE_SHEET_JS_EMULATOR_LAUNCHER),
label: 'Launch Android emulators',
enabled: false,
},
...emulators,
);
}
}
if (dropdown.length > 0) {
dropdown.push({type: 'separator' as 'separator'});
}
@@ -216,6 +196,5 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
{
selectDevice,
preferDevice,
setActiveSheet,
},
)(DevicesButton);