Skip to content

Commit

Permalink
Merge pull request #70 from ApitechFR/fix-condition
Browse files Browse the repository at this point in the history
fix: only first condition eventually applied
  • Loading branch information
LouisCorbet authored Sep 2, 2024
2 parents 85fe946 + 26a00e8 commit c535275
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,17 +573,15 @@ scada.scheme.DynamicTextRenderer.prototype.updateData = function (
//add condition textContente to set spanText
if (props.conditions && cnlDataExt.d.stat > 0) {
var cnlVal = cnlDataExt.d.val;
let isConditionSatisfied = false;
for (var cond of props.conditions) {
if (scada.scheme.calc.conditionSatisfied(cond, cnlVal)) {
if (!isConditionSatisfied && scada.scheme.calc.conditionSatisfied(cond, cnlVal)) {
isConditionSatisfied = true;
if (cond.textContent) {
spanText.text(cond.textContent);
}
}
//update font size
if (scada.scheme.calc.conditionSatisfied(cond, cnlVal)) {
this.setFontSize(spanComp, cond.fontSize);
}
break;
}
}

Expand Down

0 comments on commit c535275

Please sign in to comment.