Selaa lähdekoodia

fix for wrong context use in bolus state which led to performing the fetch on the viewContext

Marvin Polscheit 1 vuosi sitten
vanhempi
commit
0b95b9dd03
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

+ 2 - 2
FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

@@ -613,7 +613,7 @@ extension Bolus.StateModel {
     private func fetchGlucose() async -> [NSManagedObjectID] {
         CoreDataStack.shared.fetchEntities(
             ofType: GlucoseStored.self,
-            onContext: context,
+            onContext: backgroundContext,
             predicate: NSPredicate.predicateFor30MinAgo,
             key: "date",
             ascending: false,
@@ -652,7 +652,7 @@ extension Bolus.StateModel {
     private func fetchDeterminations() async -> [NSManagedObjectID] {
         CoreDataStack.shared.fetchEntities(
             ofType: OrefDetermination.self,
-            onContext: context,
+            onContext: backgroundContext,
             predicate: NSPredicate.enactedDetermination,
             key: "deliverAt",
             ascending: false,