From 4ba426debda39344b063c2470f6a3e4ca340ea22 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 2 Sep 2021 04:19:33 -0700 Subject: [PATCH] Add button for emu launch selection Summary: Based on afcoplan's feedback, now we're showing a button for launching the emulators instead of having it inline. Reviewed By: mweststrate Differential Revision: D30603659 fbshipit-source-id: edae6c63fd58647b406398c897215910938ae429 --- .../dispatcher/handleOpenPluginDeeplink.tsx | 40 +++++++++---------- desktop/flipper-plugin/src/ui/Dialog.tsx | 7 +++- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx b/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx index f7d40c087..e178118df 100644 --- a/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx +++ b/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx @@ -26,7 +26,6 @@ import isProduction, {isTest} from '../utils/isProduction'; import restart from '../utils/restartFlipper'; import BaseDevice from '../server/devices/BaseDevice'; import Client from '../Client'; -import {Button} from 'antd'; import {RocketOutlined} from '@ant-design/icons'; import {showEmulatorLauncher} from '../sandy-chrome/appinspect/LaunchEmulator'; @@ -491,41 +490,42 @@ async function launchDeviceDialog( title: string, ) { return new Promise((resolve) => { - const dialog = Dialog.alert({ + const currentDevices = store.getState().connections.devices; + const waitForNewDevice = async () => + await waitFor( + store, + (state) => state.connections.devices !== currentDevices, + ); + const dialog = Dialog.confirm({ title, - type: 'warning', message: (

To open the current deeplink for plugin {params.pluginId} a device{' '} {params.devices.length ? ' of type ' + params.devices.join(', ') : ''}{' '} should be up and running. No device was found. Please connect a device - or launch an emulator / simulator{' '} -