Resolves #1615: Prevent multiple hardware disconnect alerts.

This commit is contained in:
Evelyn Eastmond 2018-10-05 11:24:52 -04:00
parent c9d4620f22
commit 1efead8a26
2 changed files with 2 additions and 2 deletions

View file

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

View file

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