File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,10 @@ class StatusWidgetProvider: TimelineProvider {
136136
137137 var delta : HKQuantity ?
138138
139- // Making sure that previous glucose is within 5 mins of last glucose to avoid large deltas on sensor changes, missed readings, etc.
139+ // Making sure that previous glucose is within 6 mins of last glucose to avoid large deltas on sensor changes, missed readings, etc.
140140 if let prevGlucose = previousGlucose,
141141 let currGlucose = currentGlucose,
142- abs ( ( prevGlucose . startDate. addingTimeInterval ( . minutes ( 5 ) ) - currGlucose . startDate) . minutes) > 1
142+ currGlucose . startDate. timeIntervalSince ( prevGlucose . startDate) . minutes < 6
143143 {
144144 let deltaMGDL = currGlucose. quantity. doubleValue ( for: . milligramsPerDeciliter) - prevGlucose. quantity. doubleValue ( for: . milligramsPerDeciliter)
145145 delta = HKQuantity ( unit: . milligramsPerDeciliter, doubleValue: deltaMGDL)
You can’t perform that action at this time.
0 commit comments