mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
+1
-1
@@ -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": {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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<ActionButtonProps, 'tooltip' | 'icon' | 'enabled'>;
|
||||
type StateProps = Pick<
|
||||
ActionButtonProps,
|
||||
'tooltip' | 'icon' | 'enabled' | 'showProgress'
|
||||
>;
|
||||
type DispatchProps = Pick<ActionButtonProps, 'onAction'>;
|
||||
|
||||
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,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user