mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Reduce scope of variable declaration to be consistent with MQTTInNode code.
This commit is contained in:
parent
77f6652fa9
commit
5073cf8dd7
@ -116,7 +116,6 @@ module.exports = function(RED) {
|
|||||||
this.broker = n.broker;
|
this.broker = n.broker;
|
||||||
|
|
||||||
this.brokerConfig = RED.nodes.getNode(this.broker);
|
this.brokerConfig = RED.nodes.getNode(this.broker);
|
||||||
var node = this;
|
|
||||||
|
|
||||||
if (this.brokerConfig) {
|
if (this.brokerConfig) {
|
||||||
this.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
this.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||||
@ -129,6 +128,7 @@ module.exports = function(RED) {
|
|||||||
this.client.publish(msg);
|
this.client.publish(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
var node = this;
|
||||||
this.client.on("connectionlost",function() {
|
this.client.on("connectionlost",function() {
|
||||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user