Skip to content

Commit

Permalink
Fix return of falsey topic for several widgets
Browse files Browse the repository at this point in the history
to close #784
  • Loading branch information
Dave Conway-Jones committed Nov 20, 2022
1 parent ea15298 commit 02f5f56
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

### 3.2.1: Maintenance Release

- Fix topic return when topic is falsey. Issue #784
- Fix notification toast class. Issue #776
- Fix z-index of dropdown items. Issue #775

Expand Down
2 changes: 1 addition & 1 deletion dist/dashboard.appcache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CACHE MANIFEST
# Time: Fri Oct 28 2022 16:27:22 GMT+0100 (British Summer Time)
# Time: Sun Nov 20 2022 10:57:19 GMT+0000 (Greenwich Mean Time)

CACHE:
i18n.js
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_colour_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = function(RED) {
if (node.format === 'hsv') { msg.payload = pay.toHsv(); }
}
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
},
convert: function(p,o,m) {
if (m.payload === undefined || m.payload === null) { return; }
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_date_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(RED) {
},
beforeSend: function (msg) {
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
}
});
node.on("close", done);
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ module.exports = function(RED) {
msg.payload = emitOptions.value;
}
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
if (msg.payload === null || msg._dontSend) { node.status({}); }
else {
var stat = "";
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(RED) {
},
beforeSend: function (msg) {
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
}
});
node.on("close", done);
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_numeric.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = function(RED) {
beforeSend: function (msg) {
msg.payload = parseFloat(msg.payload);
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
if (node.pt) {
node.status({shape:"dot",fill:"grey",text:msg.payload});
}
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = function(RED) {
},
beforeSend: function (msg) {
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
if (node.pt) {
node.status({shape:"dot",fill:"grey",text:msg.payload});
}
Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = function(RED) {
},
beforeSend: function (msg) {
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
}
});

Expand Down
2 changes: 1 addition & 1 deletion nodes/ui_text_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function(RED) {
// if (config.mode === "week") { msg.payload = Date.parse(msg.payload); }
// if (config.mode === "month") { msg.payload = Date.parse(msg.payload); }
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
if (t) { msg.topic = t; }
if (t !== undefined) { msg.topic = t; }
}
});
node.on("close", done);
Expand Down

0 comments on commit 02f5f56

Please sign in to comment.