Skip to content

Commit

Permalink
Store most recent 6 sgvs in raw CareLink data
Browse files Browse the repository at this point in the history
  • Loading branch information
mddub committed Oct 17, 2015
1 parent e71476f commit 1929e12
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/plugins/mmconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ function makeHandler_ (entries, storeRawData) {

// trim the default 288 sgvs returned by carelink
if (data['sgs'] && data['sgs'] instanceof Array) {
console.log(data['sgs'].length);
data['sgs'] = data['sgs'].slice(0, 6);
console.log(data['sgs'].length);
data['sgs'] = data['sgs'].slice(Math.max(0, data['sgs'].length - 6));
}

transformed.push({
Expand Down

0 comments on commit 1929e12

Please sign in to comment.