diff --git a/LoopFollow/Helpers/TextFieldWithToolBar.swift b/LoopFollow/Helpers/TextFieldWithToolBar.swift index 69d80b0e..ca1f85f1 100644 --- a/LoopFollow/Helpers/TextFieldWithToolBar.swift +++ b/LoopFollow/Helpers/TextFieldWithToolBar.swift @@ -185,6 +185,7 @@ public struct TextFieldWithToolBar: UIViewRepresentable { message += "Maximum: \(self.format(quantity: maxValue, for: self.unit))" } self.onValidationError(message) + self.parent.quantity = HKQuantity(unit: self.unit, doubleValue: 0) } } else { self.onValidationError("Invalid number format") diff --git a/LoopFollow/Remote/TRC/MealView.swift b/LoopFollow/Remote/TRC/MealView.swift index 6a88df61..791488e3 100644 --- a/LoopFollow/Remote/TRC/MealView.swift +++ b/LoopFollow/Remote/TRC/MealView.swift @@ -137,9 +137,10 @@ struct MealView: View { fat.doubleValue(for: .gram()) != 0 else { return } - - alertType = .confirmMeal - showAlert = true + if !showAlert { + alertType = .confirmMeal + showAlert = true + } } }, isDisabled: isButtonDisabled