Skip to content

Commit

Permalink
Only include noise if there is noise
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Jun 6, 2023
1 parent d09355e commit 99a152f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/api2/summary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ function configure (env, ctx) {
for (let i = 0; i < sgvs.length; i++) {
const bg = sgvs[i];
if (bg.mills >= dataCap) {
bgData.push({
sgv: bg.mgdl
, mills: bg.mills
, noise: bg.noise
});

let item = {
sgv: bg.mgdl
, mills: bg.mills
};

// only push noise data if there is noise
if (bg.noise != 1) { item.noise = bg.noise; }
bgData.push(item);

}
}
return bgData;
Expand Down

0 comments on commit 99a152f

Please sign in to comment.