diff --git a/src/extensions/scratch3_microbit/index.js b/src/extensions/scratch3_microbit/index.js index ce951c717..29b5d790a 100644 --- a/src/extensions/scratch3_microbit/index.js +++ b/src/extensions/scratch3_microbit/index.js @@ -239,7 +239,7 @@ class MicroBit { * Disconnect from the micro:bit. */ disconnect () { - window.clearInterval(this._timeoutID); + window.clearTimeout(this._timeoutID); if (this._ble) { this._ble.disconnect(); } @@ -329,7 +329,7 @@ class MicroBit { this._sensors.gestureState = data[9]; // cancel disconnect timeout and start a new one - window.clearInterval(this._timeoutID); + window.clearTimeout(this._timeoutID); this._timeoutID = window.setTimeout( () => this._ble.handleDisconnectError(BLEDataStoppedError), BLETimeout