Przeglądaj źródła

Merge branch 'Crowdin' into dev

Jon B Mårtensson 2 lat temu
rodzic
commit
da8da825a7

+ 0 - 1
FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings

@@ -1165,7 +1165,6 @@ Enact a temp Basal or a temp target */
 /* */
 "Normal " = "Normal ";
 
-/* */
 "Currently no Override active" = "Currently no Override active";
 
 /* */

+ 1 - 2
FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

@@ -7,6 +7,7 @@ extension Bolus {
         @Injected() var apsManager: APSManager!
         @Injected() var broadcaster: Broadcaster!
         @Injected() var pumpHistoryStorage: PumpHistoryStorage!
+      
         @Published var amount: Decimal = 0
         @Published var insulinRecommended: Decimal = 0
         @Published var insulinRequired: Decimal = 0
@@ -14,7 +15,6 @@ extension Bolus {
         @Published var manual: Bool = false
         @Published var error: Bool = false
         @Published var errorString: Decimal = 0
-
         @Published var evBG: Int = 0
         @Published var insulin: Decimal = 0
         @Published var target: Decimal = 0
@@ -25,7 +25,6 @@ extension Bolus {
         @Published var minDelta: Decimal = 0
         @Published var expectedDelta: Decimal = 0
         @Published var minPredBG: Decimal = 0
-
         @Published var units: GlucoseUnits = .mmolL
 
         var waitForSuggestionInitial: Bool = false

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

@@ -129,10 +129,28 @@ extension Bolus {
                     secondaryButton: .cancel()
                 )
             }
+            .alert(isPresented: $displayError) {
+                Alert(
+                    title: Text("Warning!"),
+                    message: Text("\n" + NSLocalizedString(state.errorString, comment: "") + NSLocalizedString(
+                        "\n\nTap 'Add' to continue with selected amount.",
+                        comment: "Alert text to confirm bolus amount to add"
+                    )),
+                    primaryButton: .destructive(
+                        Text("Add"),
+                        action: {
+                            state.amount = state.insulinRecommended
+                            displayError = false
+                        }
+                    ),
+                    secondaryButton: .cancel()
+                )
+            }
             .onAppear {
                 configureView {
                     state.waitForSuggestionInitial = waitForSuggestion
                     state.waitForSuggestion = waitForSuggestion
+                    state.manual = manualBolus
                 }
             }
             .navigationTitle("Enact Bolus")
@@ -213,7 +231,6 @@ extension Bolus {
                         Divider()
                     }.padding(.horizontal, 10)
                 }
-                // Footer.
                 if !(state.error && state.insulinRecommended > 0) {
                     VStack {
                         Text(