Commit 1e9557c3 authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

Edit function: callback function that draws chart

Remove the logic that throws an error if there is a problem fetching
metadata and observations. It is currently not working as expected
parent 01c4ba10
......@@ -231,23 +231,6 @@ const drawChartUsingSelectedOptions = async function () {
)
);
// If there is an error in fetching metadata + observations (Case 1: raw observations)
// the returned array will have this structure: [[undefined, undefined], undefined]
// Note that the second element is not an array as we would expect but is a
// a single `undefined` value
if (typeof observationsRawPlusMetadataArr[0][0] === "undefined") {
throw new Error(
`There was a problem in fetching metadata and observations`
);
}
// If there is an error in fetching metadata + observations (Case 2: temperature difference, dT)
// a single `undefined` value instead of an array (as we would expect) will be returned
if (typeof observationsTempDiffPlusMetadataArr === "undefined")
throw new Error(
`There was a problem in calculating the temperature difference (dT).\nThis is most likely due to a problem in fetching metadata and observations`
);
// Extract the combined arrays for observations and metadata / raw observations
const [observationsRawNestedArr, metadataRawNestedArr] =
observationsRawPlusMetadataArr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment