Преглед на файлове

Fix "no temp required" yellow loop

Ivan Valkou преди 4 години
родител
ревизия
92b033bd88
променени са 2 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 4 0
      FreeAPS/Sources/Models/Suggestion.swift
  2. 1 1
      FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift

+ 4 - 0
FreeAPS/Sources/Models/Suggestion.swift

@@ -18,6 +18,10 @@ struct Suggestion: JSON, Equatable {
     let reservoir: Decimal?
     var timestamp: Date?
     var recieved: Bool?
+
+    var isNoTempRequired: Bool {
+        reason.contains("no temp required")
+    }
 }
 
 struct Predictions: JSON, Equatable {

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift

@@ -78,7 +78,7 @@ struct LoopView: View {
     }
 
     private var actualSuggestion: Suggestion? {
-        if closedLoop, suggestion?.rate != nil || suggestion?.units != nil {
+        if closedLoop, suggestion?.rate != nil || suggestion?.units != nil || suggestion?.isNoTempRequired ?? false {
             return enactedSuggestion ?? suggestion
         } else {
             return suggestion