Skip to content

Commit ff0bcfe

Browse files
authored
Shows commands on subfolders as well as the default topic (GoogleCloudPlatform#1467)
1 parent eefa430 commit ff0bcfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

iot/mqtt_example/cloudiot_mqtt_example_nodejs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ function mqttDeviceDemo(
458458
let messageStr = 'Message received: ';
459459
if (topic === `/devices/${deviceId}/config`) {
460460
messageStr = 'Config message received: ';
461-
} else if (topic === `/devices/${deviceId}/commands`) {
461+
} else if (topic.startsWith(`/devices/${deviceId}/commands`)) {
462462
messageStr = 'Command message received: ';
463463
}
464464

0 commit comments

Comments
 (0)