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

Move debug status text length check to just before dsiplay.

This commit is contained in:
Dave Conway-Jones 2020-05-19 10:57:33 +01:00
parent 1d36ce0fdf
commit a600feb5de
No known key found for this signature in database
GPG Key ID: 302A6725C594817F

View File

@ -104,7 +104,6 @@ module.exports = function(RED) {
if (err) { node.error(err); return; } if (err) { node.error(err); return; }
var output = debugMsg.msg; var output = debugMsg.msg;
var st = (typeof output === 'string') ? output : util.inspect(output); var st = (typeof output === 'string') ? output : util.inspect(output);
if (st.length > 32) { st = st.substr(0,32) + "..."; }
var fill = "grey"; var fill = "grey";
var shape = "dot"; var shape = "dot";
if (node.statusType === "auto") { if (node.statusType === "auto") {
@ -118,6 +117,7 @@ module.exports = function(RED) {
if (msg.status.hasOwnProperty("text")) { st = msg.status.text; } if (msg.status.hasOwnProperty("text")) { st = msg.status.text; }
} }
} }
if (st.length > 32) { st = st.substr(0,32) + "..."; }
node.status({fill:fill, shape:shape, text:st}); node.status({fill:fill, shape:shape, text:st});
}); });
} }