JS app launcher ui bugfix

Summary: JS App launcher wasn't appearing when no android emulators are installed

Reviewed By: nikoant

Differential Revision: D19499107

fbshipit-source-id: d062d4781747b77b708306b592ea66a1a67b93e4
This commit is contained in:
Timur Valiev
2020-01-21 09:02:13 -08:00
committed by Facebook Github Bot
parent b0caaa7254
commit 4f63d6435f

View File

@@ -147,6 +147,17 @@ class DevicesButton extends Component<Props> {
if (importedFiles.length > 1) {
dropdown.push(...importedFiles);
}
// Launch JS emulator
if (GK.get('flipper_js_client_emulator')) {
dropdown.push(
{type: 'separator' as 'separator'},
{
label: 'Launch JS Web App',
click: () =>
this.props.setActiveSheet(ACTIVE_SHEET_JS_EMULATOR_LAUNCHER),
},
);
}
// Launch Android emulators
if (androidEmulators.length > 0) {
const emulators = Array.from(androidEmulators)
@@ -162,18 +173,6 @@ class DevicesButton extends Component<Props> {
click: () => this.launchEmulator(name),
}));
// Launch JS emulator
if (GK.get('flipper_js_client_emulator')) {
dropdown.push(
{type: 'separator' as 'separator'},
{
label: 'Launch JS Web App',
click: () =>
this.props.setActiveSheet(ACTIVE_SHEET_JS_EMULATOR_LAUNCHER),
},
);
}
if (emulators.length > 0) {
dropdown.push(
{type: 'separator' as 'separator'},