Browse Source

Dabear's math fix

Ivan Valkou 4 years ago
parent
commit
f3918d12d9
1 changed files with 5 additions and 0 deletions
  1. 5 0
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 5 - 0
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -845,6 +845,11 @@ extension MainChartView {
             minValue = min(minValue, minTargetValue)
         }
 
+        if minValue == maxValue {
+            minValue = Config.minGlucose
+            maxValue = Config.maxGlucose
+        }
+
         return (min: minValue, max: maxValue)
     }