toolbar/buttons/bluetooth: show progress on disconnect

This commit is contained in:
David Lechner
2023-04-01 13:52:03 -05:00
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())}
/>
);