injecting blank payload stops twitter stream

This commit is contained in:
Dave Conway-Jones 2016-09-27 18:03:54 +01:00
parent 4c5b75f30a
commit 2c49832bda
1 changed files with 8 additions and 3 deletions

View File

@ -246,9 +246,14 @@ module.exports = function(RED) {
node.on("input", function(msg) {
if (this.tags === '') {
if (this.stream) { this.stream.destroy(); }
st = { track: [msg.payload] };
setupStream();
node.status({fill:"green", shape:"dot", text:msg.payload});
if (msg.payload !== "") {
st = { track: [msg.payload] };
setupStream();
node.status({fill:"green", shape:"dot", text:msg.payload});
}
else {
node.status({fill:"yellow", shape:"ring", text:RED._("twitter.warn.waiting")});
}
}
//We shouldn't get into this state, but just incase, check for it
else {