Procházet zdrojové kódy

Clear override text conditionally based on device

Jonas Björkert před 1 rokem
rodič
revize
8aff0214f6

+ 5 - 0
LoopFollow/Controllers/Nightscout/DeviceStatus.swift

@@ -74,6 +74,11 @@ extension MainViewController {
     func updateDeviceStatusDisplay(jsonDeviceStatus: [[String: AnyObject]]) {
         infoManager.clearInfoData(types: [.iob, .cob, .override, .battery, .pump, .target, .isf, .carbRatio, .updated, .recBolus, .tdd])
 
+        // For Loop, clear the current override here - For Trio, it is handled using treatments
+        if Storage.shared.device.value == "Loop" {
+            infoManager.clearInfoData(types: [.override])
+        }
+
         if jsonDeviceStatus.count == 0 {
             LogManager.shared.log(category: .deviceStatus, message: "Device status is empty")
             TaskScheduler.shared.rescheduleTask(id: .deviceStatus, to: Date().addingTimeInterval(5 * 60))