From 629d53701024f89d094585145830426fc3925ab2 Mon Sep 17 00:00:00 2001 From: Matthias Pfeil Date: Mon, 25 Jun 2018 14:18:51 +0200 Subject: [PATCH] fix(sidebar): Update last measurements display If one sensor has no value all following sensors were not updated. fixes #265 --- app/scripts/models/box.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/scripts/models/box.js b/app/scripts/models/box.js index 5a263be4..69577676 100644 --- a/app/scripts/models/box.js +++ b/app/scripts/models/box.js @@ -41,9 +41,7 @@ if (index) { var sensor = response.sensors[index]; - if (angular.isDefined(sensor.lastMeasurement) && - angular.isDefined(that.sensors[sensor._id].lastMeasurement) - ) { + if (sensor.lastMeasurement && that.sensors[sensor._id].lastMeasurement) { that.sensors[sensor._id].lastMeasurement.value = sensor.lastMeasurement.value; that.sensors[sensor._id].lastMeasurement.createdAt = sensor.lastMeasurement.createdAt; }