From 3b1763bd7dc9e52563ce3e3b52186d1c8bb21692 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Tue, 28 Nov 2023 03:40:23 -0800 Subject: [PATCH] explicit instructions for idb Summary: Add explicit instructions how to install idb internally Reviewed By: LukeDefeo Differential Revision: D51600754 fbshipit-source-id: c40d5d07c4cb570a7c51699ce0e4b8a67c506147 --- desktop/doctor/src/fb-stubs/messages.tsx | 8 ++++++-- desktop/doctor/src/index.tsx | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/desktop/doctor/src/fb-stubs/messages.tsx b/desktop/doctor/src/fb-stubs/messages.tsx index 5ef437295d9..7f6dfb1e1c5 100644 --- a/desktop/doctor/src/fb-stubs/messages.tsx +++ b/desktop/doctor/src/fb-stubs/messages.tsx @@ -7,8 +7,12 @@ * @format */ -export const getIdbInstallationInstructions = (idbPath: string) => - `IDB is required to use Flipper with iOS devices. It can be installed from https://github.com/facebook/idb and configured in Flipper settings. You can also disable physical iOS device support in settings. Current setting: ${idbPath} isn't a valid IDB installation.`; +export const getIdbInstallationInstructions = ( + idbPath: string, +): {message: string; commands: {title: string; command: string}[]} => ({ + message: `IDB is required to use Flipper with iOS devices. It can be installed from https://github.com/facebook/idb and configured in Flipper settings. You can also disable physical iOS device support in settings. Current setting: ${idbPath} isn't a valid IDB installation.`, + commands: [], +}); export const installXcode = 'Install Xcode from the App Store or download it from https://developer.apple.com'; diff --git a/desktop/doctor/src/index.tsx b/desktop/doctor/src/index.tsx index 6f433e5b032..f6b7b637676 100644 --- a/desktop/doctor/src/index.tsx +++ b/desktop/doctor/src/index.tsx @@ -288,13 +288,17 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks { const result = await tryExecuteCommand( `${settings?.idbPath} --help`, ); - const hasProblem = result.hasProblem; - const message = hasProblem - ? getIdbInstallationInstructions(settings.idbPath) - : 'Flipper is configured to use your IDB installation.'; + if (result.hasProblem) { + return { + hasProblem: true, + ...getIdbInstallationInstructions(settings.idbPath), + }; + } + return { - hasProblem, - message, + hasProblem: false, + message: + 'Flipper is configured to use your IDB installation.', }; }, },