Skip to content

Commit

Permalink
Bug fix. Glucose conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-b-m committed Jun 9, 2023
1 parent 47db138 commit 6355999
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ extension DataTable {
Text(state.units.rawValue)
}.padding(.horizontal, 20)
HStack {
let limitLow: Decimal = state.units == .mmolL ? 2.2 : 40
let limitHigh: Decimal = state.units == .mmolL ? 21 : 380
Button { newGlucose = false }
label: { Text("Cancel") }.frame(maxWidth: .infinity, alignment: .leading)

Expand All @@ -74,7 +76,7 @@ extension DataTable {
}
label: { Text("Save") }
.frame(maxWidth: .infinity, alignment: .trailing)
.disabled(state.manualGlcuose < 2.2 || state.manualGlcuose > 22)
.disabled(state.manualGlcuose < limitLow || state.manualGlcuose > limitHigh)

}.padding(20)
}
Expand Down

0 comments on commit 6355999

Please sign in to comment.