lift NoDevices from TroubleshootingGuide

Reviewed By: lblasa

Differential Revision: D47474152

fbshipit-source-id: 26f3857890cf32ccae8fdd017872d4d12684299f
This commit is contained in:
Anton Kastritskiy
2023-07-18 03:52:34 -07:00
committed by Facebook GitHub Bot
parent 5d2284ce4a
commit 20ebb75f97
2 changed files with 14 additions and 15 deletions

View File

@@ -32,6 +32,7 @@ import {brandColors, brandIcons, colors} from '../../ui/components/colors';
import {TroubleshootingGuide} from './fb-stubs/TroubleshootingGuide';
import {getSelectableDevices} from '../../selectors/connections';
import {getRenderHostInstance} from 'flipper-frontend-core';
import {NoDevices} from './NoDevices';
const {Text} = Typography;
@@ -82,6 +83,9 @@ export function AppSelector() {
onSelectApp,
);
const client = clients.get(selectedAppId!);
const gkSelfSufficiency = getRenderHostInstance().GK(
'flipper_self_sufficiency',
);
return (
<>
@@ -133,10 +137,14 @@ export function AppSelector() {
</Text>
</Layout.Horizontal>
)}
<TroubleshootingGuide
showGuide={getRenderHostInstance().GK('flipper_self_sufficiency')}
devicesDetected={entries.length}
/>
{
/* Return the public component NoDevices if showGuide is false (This means that the user is not in the GK Allowlist) and no devices are detected */
!gkSelfSufficiency && entries.length == 0 ? (
<NoDevices />
) : !gkSelfSufficiency && entries.length > 0 ? null : (
<TroubleshootingGuide />
)
}
</>
);
}

View File

@@ -7,15 +7,6 @@
* @format
*/
import React from 'react';
import {NoDevices} from '../NoDevices';
export function TroubleshootingGuide(_props: {
showGuide: boolean;
devicesDetected: number;
}) {
if (_props.devicesDetected == 0) return <NoDevices />;
else {
return <></>;
}
export function TroubleshootingGuide() {
return null;
}