Ivan Valkou vor 5 Jahren
Ursprung
Commit
73b89f068e
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      FreeAPS/Sources/APS/APSManager.swift

+ 3 - 2
FreeAPS/Sources/APS/APSManager.swift

@@ -125,13 +125,14 @@ final class BaseAPSManager: APSManager, Injectable {
         }()
         }()
 
 
         enactCancellable = basalPublisher
         enactCancellable = basalPublisher
-            .flatMap { _ in bolusPublisher }
+            .flatMap { bolusPublisher }
             .sink { completion in
             .sink { completion in
                 if case let .failure(error) = completion {
                 if case let .failure(error) = completion {
                     print("Loop failed with error: \(error.localizedDescription)")
                     print("Loop failed with error: \(error.localizedDescription)")
                 }
                 }
-            } receiveValue: {
+            } receiveValue: { [weak self] in
                 print("Loop succeeded")
                 print("Loop succeeded")
+                try? self?.storage.save(suggested, as: OpenAPS.Enact.enacted)
             }
             }
     }
     }
 }
 }