From 3a4fac4b02f27c4d3a5b29474e3991e5a4a383a2 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Thu, 5 Oct 2017 22:00:15 -0500 Subject: [PATCH] Simplifying Rewind-Prime reconciliation --- Loop/Extensions/DoseStore.swift | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Loop/Extensions/DoseStore.swift b/Loop/Extensions/DoseStore.swift index 3247fb08ee..825b89ceb7 100644 --- a/Loop/Extensions/DoseStore.swift +++ b/Loop/Extensions/DoseStore.swift @@ -58,10 +58,6 @@ extension LoopDataManager { value: basal.scheduleEntry.rate, unit: .unitsPerHour ) - - if isRewound { - isRewound = false - } case is RewindPumpEvent: eventType = .rewind @@ -70,15 +66,14 @@ extension LoopDataManager { If the fixed prime is cancelled, it is never recorded in history. It is possible to cancel a fixed prime and perform one manually some time later, but basal delivery will have resumed during that period. - On an x23 model pump, the point at which basal delivery resumes is unambiguous thanks to the BasalProfileStart event. - On older model pumps, we take the conservative approach and assume delivery is paused only between the Rewind and the first Prime event. + We take the conservative approach and assume delivery is paused only between the Rewind and the first Prime event. */ dose = DoseEntry(suspendDate: event.date) isRewound = true case is PrimePumpEvent: eventType = .prime - if !model.recordsBasalProfileStartEvents && isRewound { + if isRewound { isRewound = false dose = DoseEntry(resumeDate: event.date) }