Set internal connected flag before emitting event

This commit is contained in:
Paul Kaplan committed 2018-07-10 15:57:25 -04:00
1 parent e156b0536c
commit 82a33691d3
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -51,8 +51,8 @@ class BLESession extends JSONRPCWebSocket {
this.sendRemoteRequest('connect', {peripheralId: id})
.then(() => {
log.info('should have connected');
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
this._connected = true;
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
this._connectCallback();
})
.catch(e => {
+1 -1
View File
@@ -53,8 +53,8 @@ class BTSession extends JSONRPCWebSocket {
this.sendRemoteRequest('connect', {peripheralId: id})
.then(() => {
log.info('should have connected');
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
this._connected = true;
this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);
this._connectCallback();
})
.catch(e => {