Skip to content

Commit

Permalink
fix measurement without zones color
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Feb 10, 2025
1 parent f037f4d commit fd7c318
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/sensor/SensorPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -443,25 +443,21 @@ export default {
bufer.label = measurements[item].label;
bufer.unit = measurements[item].unit;
if (
measurements[item].zones &&
measurements[item].zones.find((i) => bufer.measure < i.value)
) {
bufer.color = measurements[item].zones.find(
(i) => bufer.measure < i.value
).color;
bufer.color = measurements[item].zones.find((i) => bufer.measure < i.value).color;
}
/* check for upper measure */
if (!bufer.color) {
if (
measurements[item].zones &&
bufer.measure >
measurements[item].zones[
measurements[item].zones.length - 2
].value
measurements[item].zones[measurements[item].zones.length - 2].value
) {
bufer.color =
measurements[item].zones[
measurements[item].zones.length - 1
].color;
measurements[item].zones[measurements[item].zones.length - 1].color;
}
}
Expand Down

0 comments on commit fd7c318

Please sign in to comment.