Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fixed bug with including undefined day night flag in CMR granule call.

Stephan Wlodarczykd892764150f8
diff --git a/web/js/containers/sidebar/smart-handoff.js b/web/js/containers/sidebar/smart-handoff.js
index cf9ae211f..d5d2ed9e9 100644
--- a/web/js/containers/sidebar/smart-handoff.js
+++ b/web/js/containers/sidebar/smart-handoff.js
@@ -147,13 +147,14 @@ class SmartHandoff extends Component {
let totalGranules = 0;
let selectedGranules = 0;
- const urlTotalGranules = 'https://cmr.earthdata.nasa.gov/search/granules.json?'
+ let urlTotalGranules = 'https://cmr.earthdata.nasa.gov/search/granules.json?'
+ `temporal=${dateRange}&`
+ `collection_concept_id=${selectedLayer.conceptId}&`
- + `day_night_flag=${selectedLayer.daynight}&`
+ 'include_facets=v2&'
+ 'page_size=0';
+ if (selectedLayer.daynight) urlTotalGranules += `&day_night_flag=${selectedLayer.daynight}`;
+
let urlSelectedGranules = urlTotalGranules;
totalGranules = await fetch(urlTotalGranules, { timeout: 5000 })