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 {
136
136
137
137
var delta : HKQuantity ?
138
138
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.
140
140
if let prevGlucose = previousGlucose,
141
141
let currGlucose = currentGlucose,
142
- abs ( ( prevGlucose . startDate. addingTimeInterval ( . minutes ( 5 ) ) - currGlucose . startDate) . minutes) > 1
142
+ currGlucose . startDate. timeIntervalSince ( prevGlucose . startDate) . minutes < 6
143
143
{
144
144
let deltaMGDL = currGlucose. quantity. doubleValue ( for: . milligramsPerDeciliter) - prevGlucose. quantity. doubleValue ( for: . milligramsPerDeciliter)
145
145
delta = HKQuantity ( unit: . milligramsPerDeciliter, doubleValue: deltaMGDL)
You can’t perform that action at this time.
0 commit comments