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

test -> remove determineBasal call when opening treatments view

polscm32 2 лет назад
Родитель
Сommit
26270796b1

+ 3 - 5
FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

@@ -180,13 +180,12 @@ extension Bolus {
 
 
         // CALCULATIONS FOR THE BOLUS CALCULATOR
         // CALCULATIONS FOR THE BOLUS CALCULATOR
         func calculateInsulin() -> Decimal {
         func calculateInsulin() -> Decimal {
-
-            //ensure that isf is in mg/dL
+            // ensure that isf is in mg/dL
             var conversion: Decimal {
             var conversion: Decimal {
                 units == .mmolL ? 0.0555 : 1
                 units == .mmolL ? 0.0555 : 1
             }
             }
             let isfForCalculation = isf / conversion
             let isfForCalculation = isf / conversion
-            
+
             // insulin needed for the current blood glucose
             // insulin needed for the current blood glucose
             targetDifference = (currentBG - target)
             targetDifference = (currentBG - target)
             targetDifferenceInsulin = targetDifference / isfForCalculation
             targetDifferenceInsulin = targetDifference / isfForCalculation
@@ -234,7 +233,7 @@ extension Bolus {
             return apsManager
             return apsManager
                 .roundBolus(amount: max(insulinCalculated, 0))
                 .roundBolus(amount: max(insulinCalculated, 0))
         }
         }
-        
+
         func add() async {
         func add() async {
             guard amount > 0 else {
             guard amount > 0 else {
                 showModal(for: nil)
                 showModal(for: nil)
@@ -247,7 +246,6 @@ extension Bolus {
                 let authenticated = try await unlockmanager.unlock()
                 let authenticated = try await unlockmanager.unlock()
                 if authenticated {
                 if authenticated {
                     apsManager.enactBolus(amount: maxAmount, isSMB: false)
                     apsManager.enactBolus(amount: maxAmount, isSMB: false)
-                    showModal(for: nil)
                 } else {
                 } else {
                     print("authentication failed")
                     print("authentication failed")
                 }
                 }

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

@@ -943,7 +943,7 @@ extension Home {
                     tabBarButton(index: 1, systemName: historySFSymbol, label: "History")
                     tabBarButton(index: 1, systemName: historySFSymbol, label: "History")
                     Spacer()
                     Spacer()
                     Button(action: {
                     Button(action: {
-                        state.showModal(for: .bolus(waitForSuggestion: true, fetch: false))
+                        state.showModal(for: .bolus(waitForSuggestion: false, fetch: false))
                     }) {
                     }) {
                         Image(systemName: "plus.circle.fill")
                         Image(systemName: "plus.circle.fill")
                             .font(.system(size: 45))
                             .font(.system(size: 45))