diff --git a/package.json b/package.json index bdbffe7f..293fa25b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pybricks/pybricks-code", - "version": "1.0.0-rc.1", + "version": "1.0.0-rc.2", "license": "MIT", "author": "The Pybricks Authors", "repository": { diff --git a/src/firmware/FlashButton.tsx b/src/firmware/FlashButton.tsx index c8d5d4b0..79f5b5a7 100644 --- a/src/firmware/FlashButton.tsx +++ b/src/firmware/FlashButton.tsx @@ -2,7 +2,7 @@ // Copyright (c) 2020-2021 The Pybricks Authors import { connect } from 'react-redux'; -import { HubRuntimeState } from '../hub/reducers'; +import { BleConnectionState } from '../ble/reducers'; import { BootloaderConnectionState } from '../lwp3-bootloader/reducers'; import * as notification from '../notifications/actions'; import { RootState } from '../reducers'; @@ -22,7 +22,7 @@ const mapStateToProps = (state: RootState): StateProps => ({ tooltip: state.firmware.flashing ? TooltipId.FlashProgress : TooltipId.Flash, enabled: state.bootloader.connection === BootloaderConnectionState.Disconnected && - state.hub.runtime === HubRuntimeState.Disconnected, + state.ble.connection === BleConnectionState.Disconnected, showProgress: state.firmware.flashing, progress: state.firmware.progress === null ? undefined : state.firmware.progress, }); diff --git a/src/hub/BluetoothButton.tsx b/src/hub/BluetoothButton.tsx index 2f301f37..572bd5fa 100644 --- a/src/hub/BluetoothButton.tsx +++ b/src/hub/BluetoothButton.tsx @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// Copyright (c) 2020 The Pybricks Authors +// Copyright (c) 2020-2021 The Pybricks Authors import { connect } from 'react-redux'; import { toggleBluetooth } from '../ble/actions'; @@ -11,7 +11,10 @@ import { TooltipId } from '../toolbar/i18n'; import btConnectedIcon from './bt-connected.svg'; import btDisconnectedIcon from './bt-disconnected.svg'; -type StateProps = Pick; +type StateProps = Pick< + ActionButtonProps, + 'tooltip' | 'icon' | 'enabled' | 'showProgress' +>; type DispatchProps = Pick; const mapStateToProps = (state: RootState): StateProps => { @@ -29,6 +32,7 @@ const mapStateToProps = (state: RootState): StateProps => { tooltip: TooltipId.BluetoothDisconnect, icon: btConnectedIcon, enabled: state.ble.connection === BleConnectionState.Connected, + showProgress: state.ble.connection === BleConnectionState.Connecting, }; } }; diff --git a/src/notifications/i18n.en.json b/src/notifications/i18n.en.json index d20fb9f5..0ed65d37 100644 --- a/src/notifications/i18n.en.json +++ b/src/notifications/i18n.en.json @@ -8,7 +8,7 @@ "gattPermission": "The web browser did not give permission to use Bluetooth Low Energy", "gattServiceNotFound": "Connected to hub but failed to get {serviceName} service.\nEnsure that you are using the most recent firmware.\nIf the problem persists, try removing the \"{hubName}\" device in your OS Bluetooth settings, then try connecting again.", "noWebBluetooth": "This web browser does not support Web Bluetooth or it is not enabled.", - "noBluetooth": "No Bluetooth adapter could be found. Bluetooth won't work.", + "noBluetooth": "No Bluetooth adapter could be found. Please connect or enable a Bluetooth Low Energy adapter and restart the browser.", "unexpectedError": "Unexpected error while trying to connect: {errorMessage}" }, "editor": {