mirror of
https://github.com/nasa/openmct.git
synced 2025-01-03 03:46:42 +00:00
Fix issue with missing data
This commit is contained in:
parent
21e94fd7ff
commit
101baa58e0
@ -7,14 +7,18 @@ function sortTelemetriesByDate(historicalTelemetriesPool) {
|
|||||||
const { identifier } = domainObject;
|
const { identifier } = domainObject;
|
||||||
const telemetryIdentifier = makeKeyString(identifier);
|
const telemetryIdentifier = makeKeyString(identifier);
|
||||||
historicalTelemetry.forEach((historicalTelemetryItem) => {
|
historicalTelemetry.forEach((historicalTelemetryItem) => {
|
||||||
if (!historicalTelemetryDateMap.get(historicalTelemetryItem.utc)) {
|
let telemetryTimestamp = historicalTelemetryItem.utc;
|
||||||
|
if (historicalTelemetryItem.timestamp) {
|
||||||
|
telemetryTimestamp = new Date(historicalTelemetryItem.timestamp)?.getTime();
|
||||||
|
}
|
||||||
|
if (!historicalTelemetryDateMap.get(telemetryTimestamp)) {
|
||||||
const telemetryMap = new Map();
|
const telemetryMap = new Map();
|
||||||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem);
|
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem);
|
||||||
historicalTelemetryDateMap.set(historicalTelemetryItem.utc, telemetryMap);
|
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap);
|
||||||
} else {
|
} else {
|
||||||
const telemetryMap = historicalTelemetryDateMap.get(historicalTelemetryItem.utc);
|
const telemetryMap = historicalTelemetryDateMap.get(telemetryTimestamp);
|
||||||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem);
|
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem);
|
||||||
historicalTelemetryDateMap.set(historicalTelemetryItem.utc, telemetryMap);
|
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user