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

Rename setting to `Very Low Glucose Warning`, and

* Update the setting's verboseHint
* Don't show "Rounded for pump." in popup when limited by Max Bolus
Mike Plante 1 год назад
Родитель
Сommit
1ed420d252

+ 18 - 2
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -27912,6 +27912,16 @@
         }
       }
     },
+    "Also triggered when the lowest forecasted glucose (minPredBG) is < %@ %@." : {
+      "localizations" : {
+        "en" : {
+          "stringUnit" : {
+            "state" : "new",
+            "value" : "Also triggered when the lowest forecasted glucose (minPredBG) is < %1$@ %2$@."
+          }
+        }
+      }
+    },
     "Also vibrate" : {
       "extractionState" : "manual",
       "localizations" : {
@@ -115543,6 +115553,9 @@
         }
       }
     },
+    "Note: The forecast used for this warning does not include carbs or insulin that have not yet been logged." : {
+
+    },
     "Note: These values are not used to calculate insulin dosing." : {
       "localizations" : {
         "ar" : {
@@ -166898,12 +166911,12 @@
         }
       }
     },
-    "Triggers a confirmation dialog if you attempt to bolus when glucose or forecasted glucose is < %@ %@." : {
+    "Triggers a confirmation dialog if you attempt to bolus when glucose is < %@ %@." : {
       "localizations" : {
         "en" : {
           "stringUnit" : {
             "state" : "new",
-            "value" : "Triggers a confirmation dialog if you attempt to bolus when glucose or forecasted glucose is < %1$@ %2$@."
+            "value" : "Triggers a confirmation dialog if you attempt to bolus when glucose is < %1$@ %2$@."
           }
         }
       }
@@ -173978,6 +173991,9 @@
     "Very Low Glucose Bolus Warning" : {
 
     },
+    "Very Low Glucose Warning" : {
+
+    },
     "Via Watch" : {
       "comment" : "Note added to carb entry when entered via watch"
     },

+ 8 - 2
Trio/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift

@@ -166,14 +166,20 @@ extension BolusCalculatorConfig {
                     ),
                     units: state.units,
                     type: .boolean,
-                    label: String(localized: "Very Low Glucose Bolus Warning"),
+                    label: String(localized: "Very Low Glucose Warning"),
                     miniHint: String(
                         localized: "Warning when bolusing with a very low or forecasted very low glucose."
                     ),
                     verboseHint: VStack(alignment: .leading, spacing: 10) {
                         Text("Default: OFF").bold()
                         Text(
-                            "Triggers a confirmation dialog if you attempt to bolus when glucose or forecasted glucose is < \(state.units == .mgdL ? 54.description : 54.formattedAsMmolL) \(state.units.rawValue)."
+                            "Triggers a confirmation dialog if you attempt to bolus when glucose is < \(state.units == .mgdL ? 54.description : 54.formattedAsMmolL) \(state.units.rawValue)."
+                        )
+                        Text(
+                            "Also triggered when the lowest forecasted glucose (minPredBG) is < \(state.units == .mgdL ? 54.description : 54.formattedAsMmolL) \(state.units.rawValue)."
+                        )
+                        Text(
+                            "Note: The forecast used for this warning does not include carbs or insulin that have not yet been logged."
                         )
                     }
                 )

+ 14 - 12
Trio/Sources/Modules/Treatments/View/PopupView.swift

@@ -460,18 +460,20 @@ struct PopupView: View {
                     Text("Glucose forecast is very low.")
                 } else if state.maxBolus <= iobAvailable && state.factoredInsulin > state.maxBolus {
                     Text("Max Bolus = \(insulinFormatter(state.maxBolus)) U")
-                } else if state.factoredInsulin > iobAvailable {
-                    let iobFormatted = state.iob < 0 ? "(" + insulinFormatter(state.iob) + ")" : insulinFormatter(state.iob)
-                    Text("Available IOB = \(insulinFormatter(iobAvailable)) U")
-                    Text("\(insulinFormatter(state.maxIOB)) - \(iobFormatted)")
-                        .foregroundColor(.secondary)
-                    Text("Max IOB - Current IOB")
-                        .font(.caption)
-                        .foregroundColor(.secondary)
-                }
-                if state.insulinCalculated > 0 {
-                    Text("Rounded for pump.")
-                        .foregroundColor(.secondary)
+                } else {
+                    if state.factoredInsulin > iobAvailable {
+                        let iobFormatted = state.iob < 0 ? "(" + insulinFormatter(state.iob) + ")" : insulinFormatter(state.iob)
+                        Text("Available IOB = \(insulinFormatter(iobAvailable)) U")
+                        Text("\(insulinFormatter(state.maxIOB)) - \(iobFormatted)")
+                            .foregroundColor(.secondary)
+                        Text("Max IOB - Current IOB")
+                            .font(.caption)
+                            .foregroundColor(.secondary)
+                    }
+                    if state.insulinCalculated > 0 {
+                        Text("Rounded for pump.")
+                            .foregroundColor(.secondary)
+                    }
                 }
             }
             .foregroundColor(Color.loopRed)