Skip to content

Commit

Permalink
reservoir & concentration
Browse files Browse the repository at this point in the history
  • Loading branch information
mountrcg committed Nov 7, 2024
1 parent 1ba4f28 commit 9b61389
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,22 @@ struct PumpView: View {

Spacer()

if let reservoir = reservoir {
if let insulin = reservoir {
let reservoirThreshold = reservoirFormatter
.string(from: (50 * Decimal(concentration.last?.concentration ?? 1)) as NSNumber) ?? ""
HStack {
Image(systemName: "drop.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(maxHeight: 12)
.foregroundColor(reservoirColor)
if reservoir == 0xDEAD_BEEF {
Text("50+ " + NSLocalizedString("U", comment: "Insulin unit")).font(.callout).fontWeight(.bold)
if insulin == 0xDEAD_BEEF {
Text("\(reservoirThreshold)+ " + NSLocalizedString("U", comment: "Insulin unit")).font(.callout)
.fontWeight(.bold)
} else {
Text(
reservoirFormatter
.string(from: reservoir as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit")
.string(from: (insulin * Decimal(concentration.last?.concentration ?? 1)) as NSNumber) ?? ""
)
.font(.callout).fontWeight(.bold)
}
Expand Down

0 comments on commit 9b61389

Please sign in to comment.