Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

handle edge case

Jason Kent3e56120d9f9d
diff --git a/web/js/components/layer/info/info-modal.js b/web/js/components/layer/info/info-modal.js
index 142df29da..f6cd55a3b 100644
--- a/web/js/components/layer/info/info-modal.js
+++ b/web/js/components/layer/info/info-modal.js
@@ -11,7 +11,7 @@ export default function LayerInfoModal(props) {
if (!metadata && measurementDescriptionPath) {
const url = `config/metadata/layers/${measurementDescriptionPath}.html`;
const data = await util.get(url);
- setMetadata(data || 'No metadata found.');
+ setMetadata(data);
}
};
diff --git a/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js b/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
index 08575485d..f2880853c 100644
--- a/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
+++ b/web/js/components/layer/product-picker/browse/measurement-metadata-detail.js
@@ -26,7 +26,11 @@ function MeasurementMetadataDetail (props) {
metadata[metadataPath] = { data };
setMetadata(metadata);
setLoading(false);
- }).catch(() => { setLoading(false); });
+ }).finally(() => {
+ setLoading(false);
+ });
+ } else {
+ setLoading(false);
}
}, [source]);
@@ -91,7 +95,7 @@ function MeasurementMetadataDetail (props) {
}
/* No metadata configured for this source */
- if (!metadataPath) {
+ if (!metadataPath && !layer.length) {
return (
<div className="no-results">
<FontAwesomeIcon icon="meteor" />