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) { handleSubscription(data) {
const datum = {}; const datum = {
const timeSystemKey = this.timeAPI.timeSystem().key; result: this.computeResult(data)
};
datum.result = this.computeResult(data); if (data) {
if (data && data[timeSystemKey]) { // TODO check back to see if we should format times here
datum[timeSystemKey] = data[timeSystemKey] this.timeAPI.getAllTimeSystems().forEach(timeSystem => {
datum[timeSystem.key] = data[timeSystem.key]
});
} }
this.emitEvent('criterionResultUpdated', datum); this.emitEvent('criterionResultUpdated', datum);