react-native-health-connect 3.3.1 → 3.3.3

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.
@@ -95,6 +95,7 @@ class HealthConnectManager(private val applicationContext: ReactApplicationConte
95
95
  throwUnlessClientIsAvailable(promise) {
96
96
  coroutineScope.launch {
97
97
  healthConnectClient.permissionController.revokeAllPermissions()
98
+ promise.resolve(true)
98
99
  }
99
100
  }
100
101
  }
@@ -52,7 +52,7 @@ class ReactHealthRecord {
52
52
  }
53
53
 
54
54
  fun parseWriteRecords(reactRecords: ReadableArray): List<Record> {
55
- val recordType = reactRecords.getMap(0).getString("recordType")
55
+ val recordType = reactRecords.getMap(0)?.getString("recordType")
56
56
 
57
57
  val recordClass = createReactHealthRecordInstance<Record>(recordType)
58
58
 
@@ -24,7 +24,7 @@ class ReactVo2MaxRecord : ReactHealthRecordImpl<Vo2MaxRecord> {
24
24
  Vo2MaxRecord(
25
25
  time = Instant.parse(map.getString("time")),
26
26
  zoneOffset = null,
27
- vo2MillilitersPerMinuteKilogram = map.getDouble("vo2Max"),
27
+ vo2MillilitersPerMinuteKilogram = map.getDouble("vo2MillilitersPerMinuteKilogram"),
28
28
  measurementMethod = map.getSafeInt(
29
29
  "measurementMethod",
30
30
  Vo2MaxRecord.MEASUREMENT_METHOD_OTHER
@@ -62,7 +62,10 @@ fun convertJsToRecordTypeSet(readableArray: ReadableArray?): Set<KClass<out Reco
62
62
  fun ReadableArray.toMapList(): List<ReadableMap> {
63
63
  val list = mutableListOf<ReadableMap>()
64
64
  for (i in 0 until size()) {
65
- list.add(getMap(i))
65
+ val item = getMap(i)
66
+ if (null != item) {
67
+ list.add(item)
68
+ }
66
69
  }
67
70
  return list
68
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-health-connect",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "description": "React native library for health connect (Android only)",
5
5
  "funding": "https://github.com/matinzd/react-native-health-connect?sponsor=1",
6
6
  "main": "lib/commonjs/index",