Skip to content

Commit

Permalink
Update OpenEarable.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasRoeddiger authored Sep 9, 2024
1 parent 41a6e62 commit 555d503
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion assets/js/OpenEarable.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ class BLEManager {
optionalServices: optionalServiceUUIDs
});
this.gattServer = await this.device.gatt.connect();
this.device.addEventListener('gattserverdisconnected', this.handleDisconnected.bind(this));
if (!this.device.disconnectHandlerAdded) {
this.device.addEventListener('gattserverdisconnected', this.handleDisconnected.bind(this));
this.device.disconnectHandlerAdded = true;
}

this.notifyAll(this.onConnectedSubscribers);
});
}
Expand Down

0 comments on commit 555d503

Please sign in to comment.