Skip to content

Commit

Permalink
Merge pull request #336 from loopandlearn/guardrail-improvement
Browse files Browse the repository at this point in the history
Align Carb and Bolus Guardrail Behavior
  • Loading branch information
marionbarker authored Dec 8, 2024
2 parents 0d79ca9 + e29ec28 commit 0a6b12f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions LoopFollow/Helpers/TextFieldWithToolBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 4 additions & 3 deletions LoopFollow/Remote/TRC/MealView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a6b12f

Please sign in to comment.