mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 23:12:24 -05:00
Resolves #1615: Prevent multiple hardware disconnect alerts.
This commit is contained in:
parent
c9d4620f22
commit
1efead8a26
2 changed files with 2 additions and 2 deletions
|
@ -172,7 +172,7 @@ class BLE extends JSONRPCWebSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendError (/* e */) {
|
_sendError (/* e */) {
|
||||||
this.disconnect();
|
if (this._connected) this.disconnect();
|
||||||
// log.error(`BLE error: ${JSON.stringify(e)}`);
|
// log.error(`BLE error: ${JSON.stringify(e)}`);
|
||||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
||||||
message: `Scratch lost connection to`,
|
message: `Scratch lost connection to`,
|
||||||
|
|
|
@ -115,7 +115,7 @@ class BT extends JSONRPCWebSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendError (/* e */) {
|
_sendError (/* e */) {
|
||||||
this.disconnect();
|
if (this._connected) this.disconnect();
|
||||||
// log.error(`BT error: ${JSON.stringify(e)}`);
|
// log.error(`BT error: ${JSON.stringify(e)}`);
|
||||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
||||||
message: `Scratch lost connection to`,
|
message: `Scratch lost connection to`,
|
||||||
|
|
Loading…
Reference in a new issue