فهرست منبع

NS Status upload working now off of Core Data 🚀

Deniz Cengiz 1 سال پیش
والد
کامیت
95704c1ed0

+ 2 - 1
FreeAPS/Sources/APS/Storage/DeterminationStorage.swift

@@ -157,7 +157,8 @@ final class BaseDeterminationStorage: DeterminationStorage, Injectable {
                         minGuardBG: nil,
                         minPredBG: nil,
                         threshold: self.decimal(from: orefDetermination.threshold),
-                        carbRatio: self.decimal(from: orefDetermination.carbRatio)
+                        carbRatio: self.decimal(from: orefDetermination.carbRatio),
+                        received: orefDetermination.enacted // this is actually part of NS...
                     )
                 } else {
                     print("Fetched object is not of type OrefDetermination")

+ 2 - 0
FreeAPS/Sources/Models/Determination.swift

@@ -31,6 +31,7 @@ struct Determination: JSON, Equatable {
     let minPredBG: Decimal?
     let threshold: Decimal?
     let carbRatio: Decimal?
+    let received: Bool?
 }
 
 struct Predictions: JSON, Equatable {
@@ -79,6 +80,7 @@ extension Determination {
         case minPredBG
         case threshold
         case carbRatio = "CR"
+        case received
     }
 }
 

+ 1 - 1
FreeAPS/Sources/Services/Network/NightscoutManager.swift

@@ -370,7 +370,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
         // Apparently we are too fast; so the flag update is not fast enough to have the predicate filter last suggestion out
         // If this check is truthy, set suggestion to nil so it's not uploaded again
         if let lastSuggested = lastSuggestedDetermination, let suggestion = modifiedSuggestedDetermination,
-           lastSuggested.deliverAt == suggestion.deliverAt
+           lastSuggested.deliverAt == suggestion.deliverAt 
         {
             modifiedSuggestedDetermination = nil
         }