Skip to content

Commit 3b4d882

Browse files
committed
[BACK-2685] use data derived source when available
1 parent db8fe26 commit 3b4d882

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/report.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,12 @@ class Report {
249249
}
250250

251251
buildReportQueries({ data }) {
252+
const bgSource = _.get(data, 'metaData.bgSources.current');
252253
const dataQueries = {
253254
basics: {
254255
endpoints: [],
255256
aggregationsByDate: 'basals, boluses, fingersticks, siteChanges',
256-
bgSource: 'cbg',
257+
bgSource: bgSource || 'cbg',
257258
stats: this.getStatsByChartType('basics', data),
258259
excludeDaysWithoutBolus: false,
259260
bgPrefs: this.getBGPrefs(),
@@ -288,7 +289,7 @@ class Report {
288289
smbg: {},
289290
wizard: {},
290291
},
291-
bgSource: 'cbg',
292+
bgSource: bgSource || 'cbg',
292293
bgPrefs: this.getBGPrefs(),
293294
metaData: 'latestPumpUpload, bgSources',
294295
timePrefs: this.getTimePrefs(),

0 commit comments

Comments
 (0)