Просмотр исходного кода

Fix open loop vs looping symbol

Jon Fawcett 6 лет назад
Родитель
Сommit
ee7ceb10be
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      LoopFollow/Controllers/NightScout.swift

+ 4 - 2
LoopFollow/Controllers/NightScout.swift

@@ -337,7 +337,9 @@ extension MainViewController {
                     LoopStatusLabel.text = "X"
                     latestLoopStatusString = "X"
                 } else {
+                    var wasEnacted = false
                     if let enacted = lastLoopRecord["enacted"] as? [String:AnyObject] {
+                        wasEnacted = true
                         if let lastTempBasal = enacted["rate"] as? Double {
                             // tableData[2].value = String(format:"%.1f", lastTempBasal)
                         }
@@ -369,7 +371,7 @@ extension MainViewController {
                             if bgData.count > 0 {
                                 lastBGTime = bgData[bgData.count - 1].date
                             }
-                            if tempBasalTime > lastBGTime {
+                            if tempBasalTime > lastBGTime && !wasEnacted {
                                 LoopStatusLabel.text = "⏀"
                                 latestLoopStatusString = "⏀"
                             } else {
@@ -384,7 +386,7 @@ extension MainViewController {
                     
                 }
                 
-                if ((TimeInterval(Date().timeIntervalSince1970) - lastLoopTime) / 60) > 10 {
+                if ((TimeInterval(Date().timeIntervalSince1970) - lastLoopTime) / 60) > 15 {
                     LoopStatusLabel.text = "⚠"
                     latestLoopStatusString = "⚠"
                 }