Explorar o código

Return event ID

Ivan Valkou %!s(int64=4) %!d(string=hai) anos
pai
achega
c4ae716510
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift

+ 2 - 4
FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift

@@ -56,11 +56,9 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable {
                     let isCancel = !event.isMutable && delivered != nil
                     let isCancel = !event.isMutable && delivered != nil
                     guard !isCancel else { return [] }
                     guard !isCancel else { return [] }
 
 
-                    let basalID = UUID().uuidString
-
                     return [
                     return [
                         PumpHistoryEvent(
                         PumpHistoryEvent(
-                            id: basalID,
+                            id: id,
                             type: .tempBasalDuration,
                             type: .tempBasalDuration,
                             timestamp: date,
                             timestamp: date,
                             amount: nil,
                             amount: nil,
@@ -71,7 +69,7 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable {
                             carbInput: nil
                             carbInput: nil
                         ),
                         ),
                         PumpHistoryEvent(
                         PumpHistoryEvent(
-                            id: "_" + basalID,
+                            id: "_" + id,
                             type: .tempBasal,
                             type: .tempBasal,
                             timestamp: date,
                             timestamp: date,
                             amount: nil,
                             amount: nil,