Просмотр исходного кода

tap insulinRequired in Bolusview

only for omnipod and 0.05 increments
Jon B.M 4 лет назад
Родитель
Сommit
eafcc24c87
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift

+ 2 - 1
FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift

@@ -35,7 +35,8 @@ extension Bolus {
                             ).foregroundColor(.secondary)
                         }.contentShape(Rectangle())
                             .onTapGesture {
-                                state.amount = state.inslinRecommended
+                                state.amount = max(Decimal(round(Double(state.insulinRequired) * 20) / 20.0), 0) // round to x.x5
+                                // state.amount = max(0, self.apsManager.roundBolus(amount: state.insulinRequired))  //throws arror about optional parameter being nil
                             }
                         HStack {
                             Text("Insulin recommended")