@@ -41,7 +41,8 @@ export class BluetoothManager implements IBluetoothManager {
4141 return device ;
4242 }
4343 }
44- } catch ( error ) {
44+ }
45+ catch ( error ) {
4546 console . error ( 'Connection failed:' , error ) ;
4647 throw error ;
4748 }
@@ -77,19 +78,19 @@ export class BluetoothManager implements IBluetoothManager {
7778 device . dispose ( ) ;
7879 }
7980
80- removeAllDevices ( deviceList : Array < BluetoothManager . Device > ) {
81- const devicesToRemove = [ ...deviceList ] ;
81+ removeAllDevices ( ) {
82+ const devicesToRemove = [ ...this . _deviceList ] ;
8283 for ( const device of devicesToRemove ) {
8384 this . _removeDeviceFromList ( device ) ;
8485 }
85- this . deviceListChanged . emit ( deviceList ) ;
86+ this . deviceListChanged . emit ( this . _deviceList ) ;
8687 }
8788
8889 async checkWebBluetoothSupport ( ) : Promise < boolean > {
8990 if ( ! ( 'bluetooth' in navigator ) ) {
9091 showDialog ( {
9192 title : 'Error' ,
92- body : ' Web Bluetooth is not supported in your browser. It works on Chrome and Edge. Make sure the Web Bluetooth flag is enabled in chrome://flags/.' ,
93+ body : ` Web Bluetooth is not supported in your browser. It works on Chrome and Edge. Make sure the Web Bluetooth flag is enabled in chrome://flags/.` ,
9394 buttons : [ Dialog . okButton ( { label : 'Close' } ) ]
9495 } ) ;
9596 return false ;
@@ -193,6 +194,7 @@ export namespace BluetoothManager {
193194 if ( this . native ) {
194195 try {
195196 this . native . gatt ?. disconnect ( ) ;
197+
196198 } catch ( error ) {
197199 console . error ( 'Failed to disconnect:' , error ) ;
198200 }
@@ -274,7 +276,7 @@ export namespace BluetoothManager {
274276 * Interface for the bluetooth manager.
275277 */
276278export interface IBluetoothManager {
277- removeAllDevices ( deviceList : Array < BluetoothManager . Device > ) : void ;
279+ removeAllDevices ( ) : void ;
278280 connect ( registryItem : IDeviceTypeRegistryItem ) : any ;
279281 disconnect ( device : BluetoothManager . Device ) : void ;
280282 deviceListChanged : Signal < BluetoothManager , Array < BluetoothManager . Device > > ;
0 commit comments