Return obj even when the metrics are undefined, or we will set this.metrics to undefined

This commit is contained in:
Fabio Manganiello 2019-07-02 16:12:24 +02:00
parent 75f7fbd67a
commit 1e39d3a8d2

View file

@ -50,7 +50,7 @@ Vue.component('sensors', {
Vue.set(this, 'metrics', (await Promise.all(promises)).reduce((obj, metrics) => {
if (!metrics)
return;
return obj;
for (const [name, value] of Object.entries(metrics)) {
obj[name] = value;