Prechádzať zdrojové kódy

Use .asMmolL instead of calculate it again.

(cherry picked from commit a12f70a34f5a58537faa45e8eaa2c4d54622e3d7)
Jon Mårtensson 5 rokov pred
rodič
commit
2793cbafcd

+ 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