Skip to content

Commit

Permalink
fix(sidebar): Update last measurements display
Browse files Browse the repository at this point in the history
If one sensor has no value all following sensors were not updated.

fixes #265
  • Loading branch information
mpfeil committed Jun 25, 2018
1 parent 7eed54a commit 629d537
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/scripts/models/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 629d537

Please sign in to comment.