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

get sure that either fatty meal toggle or super bolus can be enabled, but not both at the same time

polscm32 2 лет назад
Родитель
Сommit
36bda22ad1

+ 6 - 0
FreeAPS/Sources/Modules/Bolus/View/AlternativeBolusCalcRootView.swift

@@ -96,6 +96,9 @@ extension Bolus {
                             .font(.footnote)
                             .onChange(of: state.useFattyMealCorrectionFactor) { _ in
                                 state.insulinCalculated = state.calculateInsulin()
+                                if state.useFattyMealCorrectionFactor {
+                                    state.useSuperBolus = false
+                                }
                             }
                         }
                         if state.sweetMeals {
@@ -107,6 +110,9 @@ extension Bolus {
                             .font(.footnote)
                             .onChange(of: state.useSuperBolus) { _ in
                                 state.insulinCalculated = state.calculateInsulin()
+                                if state.useSuperBolus {
+                                    state.useFattyMealCorrectionFactor = false
+                                }
                             }
                         }
                     }