Fixing clearInterval > clearTimeout.

This commit is contained in:
Evelyn Eastmond 2019-03-01 10:04:56 -05:00
parent 7a1367d81a
commit 59ab3b717d

View file

@ -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