mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
only update switch Prev value after all rules are run
This commit is contained in:
parent
86a2ed652d
commit
4603f2d9ca
@ -89,7 +89,6 @@ module.exports = function(RED) {
|
|||||||
} else if (typeof v2 !== 'undefined') {
|
} else if (typeof v2 !== 'undefined') {
|
||||||
v2 = RED.util.evaluateNodeProperty(rule.v2,rule.v2t,node,msg);
|
v2 = RED.util.evaluateNodeProperty(rule.v2,rule.v2t,node,msg);
|
||||||
}
|
}
|
||||||
node.previousValue = prop;
|
|
||||||
if (rule.t == "else") { test = elseflag; elseflag = true; }
|
if (rule.t == "else") { test = elseflag; elseflag = true; }
|
||||||
if (operators[rule.t](test,v1,v2,rule.case)) {
|
if (operators[rule.t](test,v1,v2,rule.case)) {
|
||||||
onward.push(msg);
|
onward.push(msg);
|
||||||
@ -99,6 +98,7 @@ module.exports = function(RED) {
|
|||||||
onward.push(null);
|
onward.push(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
node.previousValue = prop;
|
||||||
this.send(onward);
|
this.send(onward);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
node.warn(err);
|
node.warn(err);
|
||||||
|
Loading…
Reference in New Issue
Block a user