Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LoopFollow/Remote/LoopAPNS/LoopCarbEditSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ struct LoopCarbEditSheet: View {
}

private func validateAndConfirm() {
guard alertType == nil else { return }
guard carbsAmount.doubleValue(for: .gram()) > 0 else {
alertType = .validation("Enter a carb amount, or use Delete carbs to remove the entry.")
return
Expand Down
1 change: 1 addition & 0 deletions LoopFollow/Remote/TRC/TRCMealEditView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ struct TRCMealEditView: View {
fatFocused = false
proteinFocused = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
guard alertType == nil else { return }
guard carbsValue > 0 || fatValue > 0 || proteinValue > 0 else {
alertType = .validation("Enter at least one of carbs, fat, or protein. Use Delete meal to remove the meal.")
return
Expand Down