@autorunify/capacitor-nrfmesh 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -303,6 +303,7 @@ class BleManager {
303
303
 
304
304
  while (timeCount > 0) {
305
305
  delay(timeMillis)
306
+ devicesByFilter.clear()
306
307
  synchronized(devices) {
307
308
  devices.forEach { device ->
308
309
  if (filter == "provisioned" && device.provisioned) {
@@ -318,7 +319,6 @@ class BleManager {
318
319
  if (max > 0 && devicesByFilter.size >= max) {
319
320
  break
320
321
  } else {
321
- devicesByFilter = mutableListOf()
322
322
  timeCount--;
323
323
  }
324
324
  }
@@ -328,8 +328,10 @@ class BleManager {
328
328
 
329
329
  fun disconnect(): Boolean {
330
330
  try {
331
- if (isConnected.value!!) {
331
+ if (isConnected.value == true) {
332
332
  mesh.disconnect()
333
+ } else {
334
+ async.emit(JSObject(), MESH_STATE_DISCONNECTED)
333
335
  }
334
336
 
335
337
  return isConnected.value!!
@@ -24,7 +24,7 @@ class MeshDevice {
24
24
  this.rssi = scanResult.rssi
25
25
 
26
26
  this.scanRecord = scanResult.scanRecord
27
- this.name = if (scanRecord != null) scanRecord.deviceName!! else "Unknown"
27
+ this.name = scanRecord?.deviceName ?: "Unknown"
28
28
  }
29
29
 
30
30
  fun match(scanResult: ScanResult): Boolean {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorunify/capacitor-nrfmesh",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "nrf mesh plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",