Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect appending for loop enacted status #7488

Merged
merged 1 commit into from
Jul 18, 2022
Merged
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
15 changes: 8 additions & 7 deletions lib/plugins/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,17 @@ function init (ctx) {
if (prop.lastEnacted) {
var valueParts = []

if (prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0) {
valueParts.push('<b>Temp Basal Canceled</b>')
}
if (prop.lastEnacted.rate != null) {
valueParts.push('<b>Temp Basal Started</b>')
valueParts.push(' ' + prop.lastEnacted.rate.toFixed(2) + 'U/hour for ' + prop.lastEnacted.duration + 'm')
}
if (prop.lastEnacted.bolusVolume) {
valueParts.push('<b>Automatic Bolus</b>')
valueParts.push(' ' + prop.lastEnacted.bolusVolume + 'U')
if (prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0) {
valueParts.push(' (Temp Basal Canceled)')
}
} else if (prop.lastEnacted.rate === 0 && prop.lastEnacted.duration === 0) {
valueParts.push('<b>Temp Basal Canceled</b>')
} else if (prop.lastEnacted.rate != null) {
valueParts.push('<b>Temp Basal Started</b>')
valueParts.push(' ' + prop.lastEnacted.rate.toFixed(2) + 'U/hour for ' + prop.lastEnacted.duration + 'm')
}
valueParts.push(valueString(', ', prop.lastEnacted.reason))

Expand Down