Hide emulator loading page for disabkled platforms

Reviewed By: lblasa

Differential Revision: D50405264

fbshipit-source-id: c051414ad3b269cf2bc145aa4da13c20517edb36
This commit is contained in:
Andrey Goncharov
2023-10-18 04:12:21 -07:00
committed by Facebook GitHub Bot
parent 65fef5fbc3
commit 3d4b36f14e

View File

@@ -160,7 +160,9 @@ export const LaunchEmulatorDialog = withTrackingScope(
return <NoSDKsEnabledAlert onClose={onClose} />; return <NoSDKsEnabledAlert onClose={onClose} />;
} }
const items = [ let items: (JSX.Element | null)[] = [];
if (androidEnabled) {
items.push(
<Title key="android-title" name="Android emulators" />, <Title key="android-title" name="Android emulators" />,
androidEmulators.length == 0 ? ( androidEmulators.length == 0 ? (
<Typography.Paragraph style={{textAlign: 'center'}}> <Typography.Paragraph style={{textAlign: 'center'}}>
@@ -232,7 +234,10 @@ export const LaunchEmulatorDialog = withTrackingScope(
); );
}) })
.value(), .value(),
);
}
if (iosEnabled) {
items.push(
<Title key="ios-title" name="iOS Simulators" />, <Title key="ios-title" name="iOS Simulators" />,
iosEmulators.length == 0 ? ( iosEmulators.length == 0 ? (
<Typography.Paragraph style={{textAlign: 'center'}}> <Typography.Paragraph style={{textAlign: 'center'}}>
@@ -286,7 +291,9 @@ export const LaunchEmulatorDialog = withTrackingScope(
</VirtualDeviceRow> </VirtualDeviceRow>
)) ))
.value(), .value(),
].filter((item) => item != null); );
}
items = items.filter((item) => item != null);
const loadingSpinner = ( const loadingSpinner = (
<> <>