Skip to content

Commit

Permalink
Merge pull request #807 from shankari/fix_dashboard_screen
Browse files Browse the repository at this point in the history
Handle "other" modes without mappings in the JSON
  • Loading branch information
shankari committed Jan 20, 2022
2 parents e4a74dc + 14bb822 commit f12c54b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions www/js/metrics-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,12 @@ angular.module('emission.main.metrics.mappings', ['emission.plugin.logger',
this.range_limited_motorized = opt;
console.log("Found range limited motorized mode", this.range_limited_motorized);
}
return [opt.value, opt.co2PerMeter];
});
if (angular.isDefined(opt.co2PerMeter)) {
return [opt.value, opt.co2PerMeter];
} else {
return undefined;
}
}).filter((modeCO2) => angular.isDefined(modeCO2));;
this.customPerMeterFootprint = Object.fromEntries(modeCO2PerMeter);
console.log("After populating, custom perMeterFootprint", this.customPerMeterFootprint);
}
Expand Down

0 comments on commit f12c54b

Please sign in to comment.