mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
Merge pull request #10 from mtlynch/race-condition
Fix race condition in WebBleConnection
This commit is contained in:
commit
9671e46955
1 changed files with 4 additions and 2 deletions
|
|
@ -9,7 +9,6 @@ class WebBleConnection extends Connection {
|
|||
this.gattServer = null;
|
||||
this.rxCharacteristic = null;
|
||||
this.txCharacteristic = null;
|
||||
this.init();
|
||||
}
|
||||
|
||||
static async open() {
|
||||
|
|
@ -36,8 +35,11 @@ class WebBleConnection extends Connection {
|
|||
return null;
|
||||
}
|
||||
|
||||
return new WebBleConnection(device);
|
||||
// create connection and initialize it
|
||||
const connection = new WebBleConnection(device);
|
||||
await connection.init();
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
||||
async init() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue