Commit 03e072f2 authored by Vladimir Kiryakov's avatar Vladimir Kiryakov
Browse files

fix edge error

parent 587b3eeb
......@@ -10,7 +10,6 @@ const mqttMiddleware = (function () {
let reconnectPeriod = null;
let client = null;
let interval = null;
let decoder = new TextDecoder("utf-8");
return (store) => {
let messages = [];
if (interval) clearInterval(interval);
......@@ -45,7 +44,7 @@ const mqttMiddleware = (function () {
});
client.on('message', (msgTopic, msg) => {
const message = decoder.decode(msg);
const message =msg.toString();
if (config.debug) console.info('MQTT: Message recieved.\nTopic: %s\nPayload: %s', topic, message);
if (_.isEqual(topic, msgTopic)) {
messages.push({topic, message: message, timestamp: new Date().getTime()});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment