瀏覽代碼

Dabear's math fix

Ivan Valkou 4 年之前
父節點
當前提交
f3918d12d9
共有 1 個文件被更改,包括 5 次插入0 次删除
  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)
     }