Skip to content

Commit

Permalink
dont add core metadata to csv if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed Nov 3, 2022
1 parent d39bfd5 commit fa40dd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ConnectedChart2/Download.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ const Download = (props) => {
array[index][key] = item;
});
});
const hasCoreMetadata =
core_metadata?.data_provenance?.length > 0 ||
core_metadata?.other_organisation?.length > 0 ||
core_metadata?.temporal_coverage?.length > 0;

if (include_core_metadata_download) {
if (include_core_metadata_download && hasCoreMetadata) {
const maxRowsMappedData = Object.values(mappedData).reduce((a, b) =>
a.length > b.length ? a : b,
).length;
Expand Down

0 comments on commit fa40dd4

Please sign in to comment.