Skip to content

Commit 795f610

Browse files
authored
Merge pull request #438 from loopandlearn/override-with-disabled-prediction
Ensure overrides are visible when predictions are disabled
2 parents f41efc0 + cc727e1 commit 795f610

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

LoopFollow/Controllers/Nightscout/Treatments/Overrides.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ extension MainViewController {
2121
}
2222

2323
let now = Date().timeIntervalSince1970
24-
let maxEndDate = now + Storage.shared.predictionToLoad.value * 3600
24+
let minimumFutureDisplayHours = 0.25
25+
let effectiveFutureHours = max(Storage.shared.predictionToLoad.value, minimumFutureDisplayHours)
26+
let maxEndDate = now + effectiveFutureHours * 3600
27+
2528
let graphHorizon = dateTimeUtils.getTimeIntervalNHoursAgo(N: 24 * Storage.shared.downloadDays.value)
2629

2730
for i in 0 ..< sorted.count {

0 commit comments

Comments
 (0)