Commit b1d2b106 by Chavee Issariyapat

fix client subscription

parent 8f3ef3ee
...@@ -16,7 +16,7 @@ const Coordinator = function(param={}) { ...@@ -16,7 +16,7 @@ const Coordinator = function(param={}) {
client.forward(topic, payload, options, topic, 0); client.forward(topic, payload, options, topic, 0);
}); });
if (that.localserver.sublist[deviceid] == undefined) { if (that.localserver.sublist[deviceid] == undefined || that.localserver.sublist[deviceid] == 0) {
that.remoteclient.subscribe(`@tap/shadow/updated/${deviceid}:${client.token}`); that.remoteclient.subscribe(`@tap/shadow/updated/${deviceid}:${client.token}`);
that.remoteclient.subscribe(`@tap/device/changed/${deviceid}:${client.token}`); that.remoteclient.subscribe(`@tap/device/changed/${deviceid}:${client.token}`);
that.localserver.sublist[deviceid] = { that.localserver.sublist[deviceid] = {
......
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