diff --git a/CHANGELOG.md b/CHANGELOG.md index 2993553..1c2eeec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### 🎉 New features - Add support for launching Expo updates. ([#134](https://github.com/expo/orbit/pull/134), [#137](https://github.com/expo/orbit/pull/137), [#138](https://github.com/expo/orbit/pull/138), [#144](https://github.com/expo/orbit/pull/144), [#148](https://github.com/expo/orbit/pull/148) by [@gabrieldonadel](https://github.com/gabrieldonadel)) -- Add experimental support for Windows and Linux. ([#152](https://github.com/expo/orbit/pull/152), [#157](https://github.com/expo/orbit/pull/157), [#158](https://github.com/expo/orbit/pull/158), [#160](https://github.com/expo/orbit/pull/160), [#161](https://github.com/expo/orbit/pull/161), [#165](https://github.com/expo/orbit/pull/165), [#170](https://github.com/expo/orbit/pull/170), [#171](https://github.com/expo/orbit/pull/171), [#172](https://github.com/expo/orbit/pull/172), [#173](https://github.com/expo/orbit/pull/173) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Add experimental support for Windows and Linux. ([#152](https://github.com/expo/orbit/pull/152), [#157](https://github.com/expo/orbit/pull/157), [#158](https://github.com/expo/orbit/pull/158), [#160](https://github.com/expo/orbit/pull/160), [#161](https://github.com/expo/orbit/pull/161), [#165](https://github.com/expo/orbit/pull/165), [#170](https://github.com/expo/orbit/pull/170), [#171](https://github.com/expo/orbit/pull/171), [#172](https://github.com/expo/orbit/pull/172), [#173](https://github.com/expo/orbit/pull/173), [#174](https://github.com/expo/orbit/pull/174) by [@gabrieldonadel](https://github.com/gabrieldonadel)) ### 🐛 Bug fixes diff --git a/apps/menu-bar/electron/src/main.ts b/apps/menu-bar/electron/src/main.ts index c70a968..fb999dd 100644 --- a/apps/menu-bar/electron/src/main.ts +++ b/apps/menu-bar/electron/src/main.ts @@ -36,6 +36,7 @@ const createMainWindow = () => { resizable: false, webPreferences: { devTools: true, + webSecurity: false, preload: path.join(__dirname, './preload.js'), }, skipTaskbar: true, diff --git a/apps/menu-bar/src/modules/Storage.ts b/apps/menu-bar/src/modules/Storage.ts index 823bffb..13f7fcd 100644 --- a/apps/menu-bar/src/modules/Storage.ts +++ b/apps/menu-bar/src/modules/Storage.ts @@ -20,7 +20,7 @@ export type UserPreferences = { export const defaultUserPreferences: UserPreferences = { launchOnLogin: false, emulatorWithoutAudio: false, - showIosSimulators: true, + showIosSimulators: Platform.OS === 'macos', showTvosSimulators: false, showAndroidEmulators: true, }; diff --git a/apps/menu-bar/src/providers/DevicesProvider.tsx b/apps/menu-bar/src/providers/DevicesProvider.tsx index 5ce1948..3b9647a 100644 --- a/apps/menu-bar/src/providers/DevicesProvider.tsx +++ b/apps/menu-bar/src/providers/DevicesProvider.tsx @@ -45,16 +45,22 @@ export function DevicesProvider({ children }: { children: React.ReactNode }) { showAndroidEmulators: showAndroid, } = getUserPreferences(); + const iosDevices = new Map>(); + const androidDevices = new Map< + string, + CliCommands.ListDevices.Device + >(); + + if (!showIos && !showTvos && !showAndroid) { + setDevicesPerPlatform({ + android: { error: undefined, devices: androidDevices }, + ios: { error: undefined, devices: iosDevices }, + }); + } + + const platform = showAndroid && (showIos || showTvos) ? 'all' : showAndroid ? 'android' : 'ios'; try { - const devicesList = await listDevicesAsync({ platform: 'all' }); - const iosDevices = new Map< - string, - CliCommands.ListDevices.Device - >(); - const androidDevices = new Map< - string, - CliCommands.ListDevices.Device - >(); + const devicesList = await listDevicesAsync({ platform }); if (showIos || showTvos) { devicesList.ios.devices.forEach((device) => { diff --git a/apps/menu-bar/src/windows/Settings.tsx b/apps/menu-bar/src/windows/Settings.tsx index 7cb9c0e..8d68c26 100644 --- a/apps/menu-bar/src/windows/Settings.tsx +++ b/apps/menu-bar/src/windows/Settings.tsx @@ -1,7 +1,7 @@ import { darkTheme, lightTheme } from '@expo/styleguide-native'; import { Config } from 'common-types'; import React, { Fragment, useEffect, useState } from 'react'; -import { StyleSheet, TouchableOpacity, Switch, Platform } from 'react-native'; +import { StyleSheet, TouchableOpacity, Platform } from 'react-native'; import { WindowsNavigator } from './index'; import { withApolloProvider } from '../api/ApolloClient'; @@ -9,6 +9,7 @@ import { Checkbox, View, Row, Text, Divider } from '../components'; import { Avatar } from '../components/Avatar'; import Button, { getStylesForColor } from '../components/Button'; import PathInput from '../components/PathInput'; +import { Switch } from '../components/Switch'; import SystemIconView from '../components/SystemIconView'; import { useGetCurrentUserQuery } from '../generated/graphql'; import Alert from '../modules/Alert'; @@ -30,10 +31,26 @@ import { getCurrentUserDisplayName } from '../utils/helpers'; import { addOpacity } from '../utils/theme'; import { useCurrentTheme } from '../utils/useExpoTheme'; -const osList: { label: string; key: keyof UserPreferences }[] = [ - { label: 'Android', key: 'showAndroidEmulators' }, - { label: 'iOS', key: 'showIosSimulators' }, - { label: 'tvOS (experimental)', key: 'showTvosSimulators' }, +type OsListItem = { + label: string; + key: keyof UserPreferences; + supported: boolean; + unsupportedMessage?: string; +}; +const osList: OsListItem[] = [ + { label: 'Android', key: 'showAndroidEmulators', supported: true }, + { + label: 'iOS', + key: 'showIosSimulators', + supported: Platform.OS === 'macos', + unsupportedMessage: 'macOS only', + }, + { + label: 'tvOS (experimental)', + key: 'showTvosSimulators', + supported: Platform.OS === 'macos', + unsupportedMessage: 'macOS only', + }, ]; const Settings = () => { @@ -177,7 +194,7 @@ const Settings = () => { pt="1" pb="2"> {hasSessionSecret ? ( - + {currentUser ? ( {