From 1279370fc821fd68ac9a2244f1d63d431ef398a6 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 17 May 2021 12:43:05 -0500 Subject: [PATCH] Fix firmware flash button not disabled while connecting We were using the wrong state variable to detect when BLE is disconnected. We care about the BLE connection state, not the hub runtime state here. Issue: https://github.com/pybricks/support/issues/315#issuecomment-841486591 --- src/firmware/FlashButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, });