Skip to content

Commit

Permalink
Fix for deletion of previous entered carbs when entering addcarbs vie…
Browse files Browse the repository at this point in the history
…w through add meal button in bolus view (#297)

(cherry picked from commit b0a7bf4)
  • Loading branch information
dsnallfot authored and Jon-b-m committed Nov 3, 2023
1 parent 58064ba commit 7dac4d8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ extension Bolus {
Section {
Button {
let id_ = meal.first?.id ?? ""
keepForNextWiew = true
state.backToCarbsView(complexEntry: fetch, id_)
if fetch {
keepForNextWiew = true
state.backToCarbsView(complexEntry: fetch, id_)
} else {
state.showModal(for: .addCarbs(editMode: false))
}
}
label: { Text(fetch ? "Edit Meal" : "Add Meal") }.frame(maxWidth: .infinity, alignment: .center)
}
Expand Down

0 comments on commit 7dac4d8

Please sign in to comment.