mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Fixing clearInterval > clearTimeout.
This commit is contained in:
parent
7a1367d81a
commit
59ab3b717d
1 changed files with 2 additions and 2 deletions
|
@ -239,7 +239,7 @@ class MicroBit {
|
||||||
* Disconnect from the micro:bit.
|
* Disconnect from the micro:bit.
|
||||||
*/
|
*/
|
||||||
disconnect () {
|
disconnect () {
|
||||||
window.clearInterval(this._timeoutID);
|
window.clearTimeout(this._timeoutID);
|
||||||
if (this._ble) {
|
if (this._ble) {
|
||||||
this._ble.disconnect();
|
this._ble.disconnect();
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ class MicroBit {
|
||||||
this._sensors.gestureState = data[9];
|
this._sensors.gestureState = data[9];
|
||||||
|
|
||||||
// cancel disconnect timeout and start a new one
|
// cancel disconnect timeout and start a new one
|
||||||
window.clearInterval(this._timeoutID);
|
window.clearTimeout(this._timeoutID);
|
||||||
this._timeoutID = window.setTimeout(
|
this._timeoutID = window.setTimeout(
|
||||||
() => this._ble.handleDisconnectError(BLEDataStoppedError),
|
() => this._ble.handleDisconnectError(BLEDataStoppedError),
|
||||||
BLETimeout
|
BLETimeout
|
||||||
|
|
Loading…
Reference in a new issue