瀏覽代碼

Clear override text conditionally based on device

Jonas Björkert 1 年之前
父節點
當前提交
8aff0214f6
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      LoopFollow/Controllers/Nightscout/DeviceStatus.swift

+ 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))