Browse Source

fix: check for single bluetooth listener (#32241)

Co-authored-by: VerteDinde <[email protected]>
trop[bot] 3 years ago
parent
commit
ab94340567
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/browser/api/web-contents.ts

+ 1 - 1
lib/browser/api/web-contents.ts

@@ -682,7 +682,7 @@ WebContents.prototype._init = function () {
   });
 
   this.on('select-bluetooth-device', (event, devices, callback) => {
-    if (this.listenerCount('select-bluetooth-device') === 0) {
+    if (this.listenerCount('select-bluetooth-device') === 1) {
       // Cancel it if there are no handlers
       event.preventDefault();
       callback('');