Explorar o código

Fix tempBasalString in HomeRootView sometimes not showing up

Deniz Cengiz %!s(int64=2) %!d(string=hai) anos
pai
achega
8b769d9d65
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -184,7 +184,7 @@ extension Home {
         }
         }
 
 
         var tempBasalString: String? {
         var tempBasalString: String? {
-            guard let tempRate = state.insulinFromPersistence.last?.tempBasal?.rate else {
+            guard let lastTempBasal = state.tempBasals.last?.tempBasal, let tempRate = lastTempBasal.rate else {
                 return nil
                 return nil
             }
             }
             let rateString = numberFormatter.string(from: tempRate as NSNumber) ?? "0"
             let rateString = numberFormatter.string(from: tempRate as NSNumber) ?? "0"