浏览代码

Use .asMmolL instead of calculate it again.

(cherry picked from commit a12f70a34f5a58537faa45e8eaa2c4d54622e3d7)
Jon Mårtensson 5 年之前
父节点
当前提交
2793cbafcd
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift

+ 2 - 2
FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift

@@ -63,8 +63,8 @@ struct CurrentGlucoseView: View {
         guard var recentBG = recentGlucose?.glucose
         else { return .loopYellow }
 
-        recentBG /= 18 // convert to mmol/l for calculation
-
+        recentBG = Int(recentBG.asMmolL) // convert to mmol/l for calculation
+        
         switch recentBG {
         case 4 ... 7:
             return .loopGreen