Skip to content

Commit

Permalink
Merge pull request #7488 from ps2/loop-enacted-fixes
Browse files Browse the repository at this point in the history
Fix incorrect appending for loop enacted status. LGTM.
  • Loading branch information
bewest authored Jul 18, 2022
2 parents 40b7cbf + 39936b9 commit cd5c983
Showing 1 changed file with 8 additions and 7 deletions.
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

0 comments on commit cd5c983

Please sign in to comment.