get all timesystems

This commit is contained in:
David Tsay 2020-03-03 12:50:40 -08:00
parent 8cb29ba4a9
commit b8b838f490

View File

@ -56,12 +56,14 @@ export default class TelemetryCriterion extends EventEmitter {
}
handleSubscription(data) {
const datum = {};
const timeSystemKey = this.timeAPI.timeSystem().key;
datum.result = this.computeResult(data);
if (data && data[timeSystemKey]) {
datum[timeSystemKey] = data[timeSystemKey]
const datum = {
result: this.computeResult(data)
};
if (data) {
// TODO check back to see if we should format times here
this.timeAPI.getAllTimeSystems().forEach(timeSystem => {
datum[timeSystem.key] = data[timeSystem.key]
});
}
this.emitEvent('criterionResultUpdated', datum);