Skip to content

Commit 73bd4e2

Browse files
Only needed for WebUSB case
1 parent c83dd6b commit 73bd4e2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hooks/download-hooks.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "../connection-stage-hooks";
2121
import {
2222
isNativeBluetoothConnection,
23+
isWebUSBConnection,
2324
MicrobitFlashConnection,
2425
} from "../device/connection-utils";
2526
import {
@@ -103,7 +104,6 @@ export class DownloadProjectActions {
103104
step: DownloadStep.UnplugRadioBridgeMicrobit,
104105
});
105106
} else if (isNativeBluetoothConnection(defaultConnection)) {
106-
// Disconnect input micro:bit to not trigger radio connection lost warning.
107107
await this.connectionStageActions.disconnectInputMicrobit();
108108

109109
const newState: DownloadState = {
@@ -201,8 +201,9 @@ export class DownloadProjectActions {
201201
this.connectionStageActions.disconnectInputMicrobit;
202202
}
203203

204-
// TODO: this needs to be the reset to BT mode step.
205-
this.updateStage({ step: DownloadStep.WebUsbChooseMicrobit });
204+
if (isWebUSBConnection(connection)) {
205+
this.updateStage({ step: DownloadStep.WebUsbChooseMicrobit });
206+
}
206207

207208
const result = await this.connectActions.connect(connection, {
208209
callbackIfDeviceIsSame,

0 commit comments

Comments
 (0)