Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Loop/Managers/CGM/DexCGMManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final class ShareClientManager: CGMManager {

// Ignore glucose values that are up to a minute newer than our previous value, to account for possible time shifting in Share data
let startDate = self.delegate?.startDateToFilterNewData(for: self)?.addingTimeInterval(TimeInterval(minutes: 1))
let newGlucose = glucose.filterDateRange(startDate, nil).map {
let newGlucose = glucose.filterDateRange(startDate, nil).filter({ $0.isStateValid }).map {
return (quantity: $0.quantity, date: $0.startDate, isDisplayOnly: false)
}

Expand Down
20 changes: 10 additions & 10 deletions Loop/Managers/LoopDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,6 @@ final class LoopDataManager {
throw LoopError.configurationError("Check settings")
}

let pendingInsulin = try self.getPendingInsulin()

guard lastRequestedBolus == nil
else {
// Don't recommend changes if a bolus was just requested.
Expand All @@ -903,20 +901,22 @@ final class LoopDataManager {
}

let tempBasal = predictedGlucose.recommendedTempBasal(
to: glucoseTargetRange,
suspendThreshold: settings.suspendThreshold?.quantity,
sensitivity: insulinSensitivity,
model: model,
basalRates: basalRates,
maxBasalRate: maxBasal,
lastTempBasal: lastTempBasal
)
to: glucoseTargetRange,
suspendThreshold: settings.suspendThreshold?.quantity,
sensitivity: insulinSensitivity,
model: model,
basalRates: basalRates,
maxBasalRate: maxBasal,
lastTempBasal: lastTempBasal
)

if let temp = tempBasal {
recommendedTempBasal = (recommendation: temp, date: startDate)
} else {
recommendedTempBasal = nil
}

let pendingInsulin = try self.getPendingInsulin()

let recommendation = predictedGlucose.recommendedBolus(
to: glucoseTargetRange,
Expand Down
1 change: 1 addition & 0 deletions Loop/Models/ServiceAuthentication/AmplitudeService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class AmplitudeService: ServiceAuthentication {

isAuthorized = true
let client = Amplitude()
client.disableIdfaTracking()
client.disableLocationListening()
client.initializeApiKey(APIKey)
self.client = client
Expand Down
2 changes: 1 addition & 1 deletion Loop/Models/ShareGlucose+GlucoseKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension ShareGlucose: GlucoseValue {

extension ShareGlucose: SensorDisplayable {
public var isStateValid: Bool {
return glucose >= 20
return glucose >= 39
}

public var trendType: GlucoseTrend? {
Expand Down