Explorar el Código

fetch carbs of the last 24h

polscm32 hace 2 años
padre
commit
22eeedfbf3
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift

+ 1 - 1
FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift

@@ -113,7 +113,7 @@ final class OpenAPS {
     private func fetchCarbs() -> [CarbEntryStored]? {
         do {
             debugPrint("OpenAPS: \(#function) \(DebuggingIdentifiers.succeeded) fetched carbs")
-            return try context.fetch(CarbEntryStored.fetch(NSPredicate.predicateFor30MinAgo, ascending: true))
+            return try context.fetch(CarbEntryStored.fetch(NSPredicate.predicateForOneDayAgo, ascending: false))
         } catch {
             debugPrint("OpenAPS: \(#function) \(DebuggingIdentifiers.failed) failed to fetch carbs with error: \(error)")
             return []