Skip to content
Merged
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
6 changes: 5 additions & 1 deletion LoopFollow/Charts/BGChartStubs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ extension MainViewController {
}

// Removes the Trio/OpenAPS forecast (ZT/IOB/COB/UAM lines and the cone). Used when the active system switches away from Trio/OpenAPS.
// Also drops the stored predBGs: the device observer calls updateOpenAPSPredictionDisplay after this runs,
// and would otherwise redraw the cleared forecast from them.
func clearOpenAPSPredictionGraph() {
let hasLineData = !ztPredictionData.isEmpty || !iobPredictionData.isEmpty || !cobPredictionData.isEmpty || !uamPredictionData.isEmpty
guard hasLineData || !chartModel.cone.isEmpty else { return }
guard hasLineData || !chartModel.cone.isEmpty || openAPSPredBGs != nil else { return }
openAPSPredBGs = nil
openAPSPredUpdatedTime = nil
ztPredictionData = []
iobPredictionData = []
cobPredictionData = []
Expand Down
Loading