소스 검색

small fixes

polscm32 2 년 전
부모
커밋
d5ef584baf
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 6
      FreeAPS/Sources/Modules/Bolus/View/AlternativeBolusCalcRootView.swift

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

@@ -473,7 +473,7 @@ extension Bolus {
                                 if !state.externalInsulin {
                                 if !state.externalInsulin {
                                     Text(exceededMaxBolus ? "Max Bolus exceeded!" : "Enact bolus")
                                     Text(exceededMaxBolus ? "Max Bolus exceeded!" : "Enact bolus")
                                 } else {
                                 } else {
-                                    Text("Log external insulin")
+                                    Text(exceededMaxBolus ? "Max Bolus exceeded!" : "Log external insulin")
                                 }
                                 }
                             }
                             }
                             .frame(maxWidth: .infinity, alignment: .center)
                             .frame(maxWidth: .infinity, alignment: .center)
@@ -496,12 +496,9 @@ extension Bolus {
                                 // show loading bar only when carbs are actually added
                                 // show loading bar only when carbs are actually added
                                 if state.carbs > 0 {
                                 if state.carbs > 0 {
                                     state.waitForSuggestion = true
                                     state.waitForSuggestion = true
-                                } else {
-                                    // otherwise close view, because hideModal() is otherwise only excecuted after a suggestion update, see StateModal
-                                    state.hideModal()
+                                    state.addCarbs()
+                                    state.addButtonPressed = true
                                 }
                                 }
-                                state.addButtonPressed = true
-                                state.addCarbs()
                             }
                             }
                             label: { Text("Continue without bolus") }
                             label: { Text("Continue without bolus") }
                                 .frame(maxWidth: .infinity, alignment: .center)
                                 .frame(maxWidth: .infinity, alignment: .center)