mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Set internal connected flag before emitting event
This commit is contained in:
parent
e156b0536c
commit
82a33691d3
2 changed files with 2 additions and 2 deletions
|
@ -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 => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in a new issue