1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix mqtt nodes not reconnected on modified-flows deploy

This commit is contained in:
Nick O'Leary 2022-12-27 14:56:32 +00:00
parent b3ce0c0079
commit ce57ba80eb
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -718,9 +718,10 @@ module.exports = function(RED) {
node.deregister = function(mqttNode, done, autoDisconnect) {
delete node.users[mqttNode.id];
if (autoDisconnect && !node.closing && node.connected && Object.keys(node.users).length === 0) {
node.disconnect();
node.disconnect(done);
} else {
done();
}
done();
};
node.canConnect = function() {
return !node.connected && !node.connecting;