@reactoo/watchtogether-sdk-js 2.7.56 → 2.7.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/watchtogether-sdk.min.js +2 -2
- package/package.json +1 -1
- package/src/models/iot.js +2 -42
package/package.json
CHANGED
package/src/models/iot.js
CHANGED
|
@@ -45,19 +45,9 @@ let iot = function () {
|
|
|
45
45
|
},
|
|
46
46
|
|
|
47
47
|
onConnect: (data, connectionId) => {
|
|
48
|
-
|
|
49
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
48
|
this.__privates.iot.log('MQTT client connected');
|
|
54
49
|
},
|
|
55
50
|
onClosed: (data, connectionId) => {
|
|
56
|
-
|
|
57
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
51
|
this.__privates.iot.log('MQTT client closed');
|
|
62
52
|
if(shouldBeConnected && !isReconnecting) {
|
|
63
53
|
this.__privates.iot.log('Connection unexpectedly closed, reconnecting...');
|
|
@@ -65,28 +55,13 @@ let iot = function () {
|
|
|
65
55
|
}
|
|
66
56
|
},
|
|
67
57
|
onError: (data, connectionId) => {
|
|
68
|
-
|
|
69
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
58
|
this.__privates.iot.log('MQTT client error');
|
|
74
59
|
},
|
|
75
60
|
onDisconnect: (data, connectionId) => {
|
|
76
|
-
|
|
77
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
61
|
this.__privates.iot.log('MQTT client disconnect');
|
|
82
62
|
},
|
|
83
63
|
onInterrupt: (data, connectionId) => {
|
|
84
|
-
|
|
85
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if(shouldBeConnected && !isReconnecting && !document.hidden && interruptCount > 10) {
|
|
64
|
+
if(shouldBeConnected && !isReconnecting && interruptCount > 10) {
|
|
90
65
|
this.__privates.iot.log('Interrupt count exceeded, reconnecting...');
|
|
91
66
|
this.iot.__updateCredentials();
|
|
92
67
|
}
|
|
@@ -94,28 +69,13 @@ let iot = function () {
|
|
|
94
69
|
this.__privates.iot.log('MQTT client interrupt');
|
|
95
70
|
},
|
|
96
71
|
onResume: (data, connectionId) => {
|
|
97
|
-
|
|
98
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
72
|
this.__privates.iot.log('MQTT client resume');
|
|
103
73
|
},
|
|
104
74
|
onConnectionSuccess: (data, connectionId) => {
|
|
105
|
-
|
|
106
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
75
|
this.__privates.iot.log('MQTT client connection_success');
|
|
111
76
|
},
|
|
112
77
|
onConnectionFailure: (data, connectionId) => {
|
|
113
|
-
|
|
114
|
-
if(this.__privates.iot.currentConnectionId !== null && this.__privates.iot.currentConnectionId !== connectionId) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if(shouldBeConnected && !isReconnecting && !document.hidden && interruptCount > 10) {
|
|
78
|
+
if(shouldBeConnected && !isReconnecting && interruptCount > 10) {
|
|
119
79
|
this.__privates.iot.log('Interrupt count exceeded, reconnecting...');
|
|
120
80
|
this.iot.__updateCredentials();
|
|
121
81
|
}
|