Skip to content

Commit 02f5f56

Browse files
author
Dave Conway-Jones
committed
Fix return of falsey topic for several widgets
to close #784
1 parent ea15298 commit 02f5f56

File tree

10 files changed

+10
-9
lines changed

10 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
### 3.2.1: Maintenance Release
33

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

dist/dashboard.appcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# Time: Fri Oct 28 2022 16:27:22 GMT+0100 (British Summer Time)
2+
# Time: Sun Nov 20 2022 10:57:19 GMT+0000 (Greenwich Mean Time)
33

44
CACHE:
55
i18n.js

nodes/ui_colour_picker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = function(RED) {
4949
if (node.format === 'hsv') { msg.payload = pay.toHsv(); }
5050
}
5151
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
52-
if (t) { msg.topic = t; }
52+
if (t !== undefined) { msg.topic = t; }
5353
},
5454
convert: function(p,o,m) {
5555
if (m.payload === undefined || m.payload === null) { return; }

nodes/ui_date_picker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = function(RED) {
4545
},
4646
beforeSend: function (msg) {
4747
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
48-
if (t) { msg.topic = t; }
48+
if (t !== undefined) { msg.topic = t; }
4949
}
5050
});
5151
node.on("close", done);

nodes/ui_dropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ module.exports = function(RED) {
181181
msg.payload = emitOptions.value;
182182
}
183183
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
184-
if (t) { msg.topic = t; }
184+
if (t !== undefined) { msg.topic = t; }
185185
if (msg.payload === null || msg._dontSend) { node.status({}); }
186186
else {
187187
var stat = "";

nodes/ui_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = function(RED) {
3737
},
3838
beforeSend: function (msg) {
3939
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
40-
if (t) { msg.topic = t; }
40+
if (t !== undefined) { msg.topic = t; }
4141
}
4242
});
4343
node.on("close", done);

nodes/ui_numeric.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function(RED) {
4343
beforeSend: function (msg) {
4444
msg.payload = parseFloat(msg.payload);
4545
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
46-
if (t) { msg.topic = t; }
46+
if (t !== undefined) { msg.topic = t; }
4747
if (node.pt) {
4848
node.status({shape:"dot",fill:"grey",text:msg.payload});
4949
}

nodes/ui_slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function(RED) {
3939
},
4040
beforeSend: function (msg) {
4141
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
42-
if (t) { msg.topic = t; }
42+
if (t !== undefined) { msg.topic = t; }
4343
if (node.pt) {
4444
node.status({shape:"dot",fill:"grey",text:msg.payload});
4545
}

nodes/ui_switch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ module.exports = function(RED) {
135135
},
136136
beforeSend: function (msg) {
137137
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
138-
if (t) { msg.topic = t; }
138+
if (t !== undefined) { msg.topic = t; }
139139
}
140140
});
141141

nodes/ui_text_input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = function(RED) {
4141
// if (config.mode === "week") { msg.payload = Date.parse(msg.payload); }
4242
// if (config.mode === "month") { msg.payload = Date.parse(msg.payload); }
4343
var t = RED.util.evaluateNodeProperty(config.topic,config.topicType || "str",node,msg) || node.topi;
44-
if (t) { msg.topic = t; }
44+
if (t !== undefined) { msg.topic = t; }
4545
}
4646
});
4747
node.on("close", done);

0 commit comments

Comments
 (0)