polscm32 hace 2 años
padre
commit
55b389a6fe
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. 9 3
      FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift

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

@@ -12,7 +12,7 @@ struct LoopView: View {
 
     @FetchRequest(
         fetchRequest: OrefDetermination
-            .fetch(NSPredicate.enactedDetermination)
+            .fetch(NSPredicate.predicateFor30MinAgoForDetermination)
     ) var determination: FetchedResults<OrefDetermination>
 
     @Binding var closedLoop: Bool
@@ -42,7 +42,11 @@ struct LoopView: View {
                 Text("looping")
             } else if manualTempBasal {
                 Text("Manual")
-            } else if determination.first?.deliverAt != nil { //previously the .timestamp property was used here because this only gets updated when the reportenacted function in the aps manager gets called
+            } else if determination.first?
+                .deliverAt !=
+                nil
+            {
+                // previously the .timestamp property was used here because this only gets updated when the reportenacted function in the aps manager gets called
                 Text(timeString)
             } else {
                 Text("--")
@@ -62,7 +66,9 @@ struct LoopView: View {
     }
 
     private var color: Color {
-        guard determination.first?.deliverAt != nil else { //previously the .timestamp property was used here because this only gets updated when the reportenacted function in the aps manager gets called
+        guard determination.first?.deliverAt != nil
+        else {
+            // previously the .timestamp property was used here because this only gets updated when the reportenacted function in the aps manager gets called
             return .secondary
         }
         guard manualTempBasal == false else {