From d128d2146aa746dedb7b7eee9c4beb2eff40c75f Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 15 Feb 2024 09:49:59 +0000 Subject: [PATCH] Online status --- examples/mqtt-dashboard/dashboard/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/mqtt-dashboard/dashboard/main.js b/examples/mqtt-dashboard/dashboard/main.js index d4bc060e..8948fb42 100644 --- a/examples/mqtt-dashboard/dashboard/main.js +++ b/examples/mqtt-dashboard/dashboard/main.js @@ -450,8 +450,8 @@ const App = function() { }); }; - subscribe(statusTopic) - subscribe(txTopic) + subscribe(statusTopic); + subscribe(txTopic); }); MqttClient.on('message', (topic, message) => { @@ -472,7 +472,8 @@ const App = function() { console.error('Invalid response'); return; } - device.online = params.status === 'online' + device.online = params.status === 'online'; + setConnected(device.online); if (device.online) { device.config = params; if (!device.config.pins) device.config.pins = [];