From 4f63d6435f742cf39223a693e0be6cac68c57c37 Mon Sep 17 00:00:00 2001 From: Timur Valiev Date: Tue, 21 Jan 2020 09:02:13 -0800 Subject: [PATCH] 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 --- src/chrome/DevicesButton.tsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/chrome/DevicesButton.tsx b/src/chrome/DevicesButton.tsx index 6f6d35dfc..c7836cf25 100644 --- a/src/chrome/DevicesButton.tsx +++ b/src/chrome/DevicesButton.tsx @@ -147,6 +147,17 @@ class DevicesButton extends Component { 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 { 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'},