Skip to content

Commit

Permalink
Merge pull request nightscout#40 from nightscout/dev
Browse files Browse the repository at this point in the history
Fixes an issue where treatment units were all rewritten on load, rega…
  • Loading branch information
swissalpine committed Jan 28, 2022
2 parents e691c3e + aca8d5a commit 127b881
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/data/ddata.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ function init () {
ddata.tempbasalTreatments = ddata.processDurations(tempbasalTreatments, false);

// filter temp target
var tempTargetTreatments = ddata.treatments.filter(function filterTargets (t) {
var tempTargetTreatments = ddata.treatments.filter(function filterTargets (tt) {

// Clone the treatment before modifying it
let t = _.cloneDeep(tt);

//check for a units being sent
if (t.units) {
if (t.units == 'mmol') {
Expand Down

0 comments on commit 127b881

Please sign in to comment.