Skip to content

Commit

Permalink
fix(event-state): Use the correct clear for setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Oct 6, 2020
1 parent 6a0a395 commit db39c3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nodes/events-state-changed/events-state-changed.js
Expand Up @@ -158,7 +158,7 @@ module.exports = function (RED) {
text: statusText,
});

clearInterval(this.topics[eventMessage.entity_id].id);
clearTimeout(this.topics[eventMessage.entity_id].id);
this.topics[eventMessage.entity_id].id = setTimeout(
this.output.bind(this, eventMessage, isIfState),
timeout
Expand Down Expand Up @@ -219,7 +219,7 @@ module.exports = function (RED) {
: ''
}`;

clearInterval(this.topics[eventMessage.entity_id].id);
clearTimeout(this.topics[eventMessage.entity_id].id);

// Handle version 0 'halt if' outputs. The output were reversed true
// was sent to the second output and false was the first output
Expand Down

0 comments on commit db39c3d

Please sign in to comment.