Sfoglia il codice sorgente

fetch carbs of the last 24h

polscm32 2 anni fa
parent
commit
22eeedfbf3
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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 []