mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
toolbar/buttons/bluetooth: show progress on disconnect
This commit is contained in:
committed by
David Lechner
parent
379965e48f
commit
c8e7e86da0
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// Copyright (c) 2020-2022 The Pybricks Authors
|
||||
// Copyright (c) 2020-2023 The Pybricks Authors
|
||||
|
||||
import React from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
@@ -34,7 +34,10 @@ const BluetoothButton: React.VoidFunctionComponent<BluetoothButtonProps> = ({ id
|
||||
)}
|
||||
icon={isDisconnected ? disconnectedIcon : connectedIcon}
|
||||
enabled={isDisconnected || bleConnection === BleConnectionState.Connected}
|
||||
showProgress={bleConnection === BleConnectionState.Connecting}
|
||||
showProgress={
|
||||
bleConnection === BleConnectionState.Connecting ||
|
||||
bleConnection === BleConnectionState.Disconnecting
|
||||
}
|
||||
onAction={() => dispatch(toggleBluetooth())}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user