mirror of
https://github.com/node-red/node-red
synced 2024-11-23 17:23:56 +00:00
Ensure trigger node properties work with evaluateNodeProperty
This commit is contained in:
parent
d0ad62a82b
commit
b3aff3a3e6
@ -24,6 +24,14 @@ module.exports = function(RED) {
|
||||
this.op2 = n.op2 || "0";
|
||||
this.op1type = n.op1type || "str";
|
||||
this.op2type = n.op2type || "str";
|
||||
// If the op1/2type is 'date', then we need to leave op1/2 alone so that
|
||||
// evaluateNodeProperty works as expected.
|
||||
if (this.op1type === 'date' && this.op1 === '1') {
|
||||
this.op1 = ''
|
||||
}
|
||||
if (this.op2type === 'date' && this.op2 === '0') {
|
||||
this.op2 = ''
|
||||
}
|
||||
this.second = (n.outputs == 2) ? true : false;
|
||||
this.topic = n.topic || "topic";
|
||||
|
||||
@ -213,7 +221,6 @@ module.exports = function(RED) {
|
||||
}
|
||||
else {
|
||||
msg2.payload = node.topics[topic].m2;
|
||||
if (node.op2type === "date") { msg2.payload = Date.now(); }
|
||||
if (node.second === true) { msgInfo.send([null,msg2]); }
|
||||
else { msgInfo.send(msg2); }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user