react-native-mytatva-rn-sdk 1.2.57 → 1.2.59
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.
|
@@ -186,7 +186,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
186
186
|
)*/
|
|
187
187
|
val response = Gson().fromJson(apiResponse, CgmSensorResponse::class.java)
|
|
188
188
|
val sensor = response.data?.firstOrNull()
|
|
189
|
-
|
|
189
|
+
Log.d("delete1111", "startingggg")
|
|
190
190
|
|
|
191
191
|
if (sensor != null && !sensor.startDate.isNullOrEmpty() && !sensor.endDate.isNullOrEmpty()) {
|
|
192
192
|
val startDate = sensor.startDate
|
|
@@ -196,7 +196,9 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
196
196
|
val lastPatientId = prefsHelper?.lastPatientId
|
|
197
197
|
val lastSensorId = prefsHelper?.qrInformation?.sensor
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
|
|
200
|
+
if (lastPatientId != null && lastSensorId != null && lastPatientId.isNotEmpty() && lastSensorId.isNotEmpty() && (lastPatientId != currentPatientId || lastSensorId != sensorId)) {
|
|
201
|
+
Log.d("delete1111", "deleting database");
|
|
200
202
|
mModel.clearAllGlucoseAndDeviceData()
|
|
201
203
|
return
|
|
202
204
|
}
|
|
@@ -596,6 +598,7 @@ class CgmTrackyLibModule(reactContext: ReactApplicationContext) :
|
|
|
596
598
|
CoroutineScope(Dispatchers.IO).launch {
|
|
597
599
|
// Step 1: Clear DB first if needed
|
|
598
600
|
if (isForClear) {
|
|
601
|
+
Log.d("delete1111-observe", "observe delete")
|
|
599
602
|
mModel.clearAllGlucoseAndDeviceData() // suspend or blocking DB operation
|
|
600
603
|
}
|
|
601
604
|
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import UIKit
|
|
9
9
|
import AVFoundation
|
|
10
10
|
class ConnectToSensorViewController: UIViewController {
|
|
11
|
+
let viewModel = FinalViewModel()
|
|
12
|
+
|
|
11
13
|
@IBOutlet weak var contactSupport: CustomOverlayButton!
|
|
12
14
|
@IBOutlet weak var customTopView: CustomTopUIView!
|
|
13
15
|
@IBOutlet weak var tableView: UITableView!
|
|
@@ -51,6 +53,7 @@ class ConnectToSensorViewController: UIViewController {
|
|
|
51
53
|
var isCodeDetected = false
|
|
52
54
|
var isPermissionGiven: Bool = false
|
|
53
55
|
let manager = KLTBluetoothManager.shared()
|
|
56
|
+
let debouncer = EnumDebouncer<CGMConnectionStatus>()
|
|
54
57
|
|
|
55
58
|
override func viewDidLoad() {
|
|
56
59
|
super.viewDidLoad()
|
|
@@ -240,6 +243,7 @@ class ConnectToSensorViewController: UIViewController {
|
|
|
240
243
|
UserDefaults.standard.synchronize()
|
|
241
244
|
//self.connected?()
|
|
242
245
|
//controller.navigationController?.popViewController(animated: true)
|
|
246
|
+
viewModel.debouncer.update(with: .connected)
|
|
243
247
|
self.showConfirmInsulinUser()
|
|
244
248
|
//showConfirmInsulinUser()
|
|
245
249
|
return
|