react-native-polar-bridge 0.2.5 → 0.2.6

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.
@@ -626,7 +626,11 @@ class PolarBridgeModule(reactContext: ReactApplicationContext) :
626
626
 
627
627
  override fun fetchHrData(deviceId: String, ms: Double?) {
628
628
  Log.e(TAG, "Fetch Heart Data called on: $deviceId ")
629
- val bufferMs = ms?.toLong()?.takeIf { it >= 0 } ?: SENSOR_BUFFER_MS
629
+ val bufferMs: Long = if (ms != null && ms >= 0) {
630
+ ms.toLong()
631
+ } else {
632
+ SENSOR_BUFFER_MS
633
+ }
630
634
  val isDisposed = hrDisposable?.isDisposed ?: true
631
635
  try{
632
636
  if (isDisposed) {
@@ -733,7 +737,11 @@ class PolarBridgeModule(reactContext: ReactApplicationContext) :
733
737
 
734
738
  override fun fetchAccData(deviceId: String, ms: Double?) {
735
739
  Log.e(TAG, "Fetch Accelerometer Data called on: $deviceId ")
736
- val bufferMs = ms?.toLong()?.takeIf { it >= 0 } ?: SENSOR_BUFFER_MS
740
+ val bufferMs: Long = if (ms != null && ms >= 0) {
741
+ ms.toLong()
742
+ } else {
743
+ SENSOR_BUFFER_MS
744
+ }
737
745
  val isDisposed = accDisposable?.isDisposed ?: true
738
746
  try{
739
747
  if (isDisposed) {
@@ -790,7 +798,11 @@ class PolarBridgeModule(reactContext: ReactApplicationContext) :
790
798
 
791
799
  override fun fetchGyrData(deviceId: String, ms: Double?) {
792
800
  Log.e(TAG, "Fetch Gyroscope Data called on: $deviceId ")
793
- val bufferMs = ms?.toLong()?.takeIf { it >= 0 } ?: SENSOR_BUFFER_MS
801
+ val bufferMs: Long = if (ms != null && ms >= 0) {
802
+ ms.toLong()
803
+ } else {
804
+ SENSOR_BUFFER_MS
805
+ }
794
806
  val isDisposed = gyrDisposable?.isDisposed ?: true
795
807
  try {
796
808
  if (isDisposed) {
@@ -849,7 +861,11 @@ class PolarBridgeModule(reactContext: ReactApplicationContext) :
849
861
 
850
862
  override fun fetchPpgData(deviceId: String, ms: Double?) {
851
863
  Log.e(TAG, "Fetch Photoplethysmograph Data called on: $deviceId ")
852
- val bufferMs = ms?.toLong()?.takeIf { it >= 0 } ?: SENSOR_BUFFER_MS
864
+ val bufferMs: Long = if (ms != null && ms >= 0) {
865
+ ms.toLong()
866
+ } else {
867
+ SENSOR_BUFFER_MS
868
+ }
853
869
  val isDisposed = ppgDisposable?.isDisposed ?: true
854
870
  try {
855
871
  if (isDisposed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-polar-bridge",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Polar SDK for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",