Resolves #1615: Prevent multiple hardware disconnect alerts.
This commit is contained in:
1 parent
c9d4620f22
commit
1efead8a26
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -172,7 +172,7 @@ class BLE extends JSONRPCWebSocket {
|
||||
}
|
||||
|
||||
_sendError (/* e */) {
|
||||
this.disconnect();
|
||||
if (this._connected) this.disconnect();
|
||||
// log.error(`BLE error: ${JSON.stringify(e)}`);
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
||||
message: `Scratch lost connection to`,
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ class BT extends JSONRPCWebSocket {
|
||||
}
|
||||
|
||||
_sendError (/* e */) {
|
||||
this.disconnect();
|
||||
if (this._connected) this.disconnect();
|
||||
// log.error(`BT error: ${JSON.stringify(e)}`);
|
||||
this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR, {
|
||||
message: `Scratch lost connection to`,
|
||||
|
||||
Reference in new issue
Block a user