@reactoo/watchtogether-sdk-js 2.7.44-beta.3 → 2.7.44-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactoo/watchtogether-sdk-js",
3
- "version": "2.7.44-beta.3",
3
+ "version": "2.7.44-beta.4",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "src/index.js",
6
6
  "unpkg": "dist/watchtogether-sdk.min.js",
package/src/models/iot.js CHANGED
@@ -235,6 +235,11 @@ let iot = function () {
235
235
  keepAliveIntervalId = setInterval(() => {
236
236
  this.__privates.iot.checkConnection()
237
237
  .catch(error => {
238
+
239
+ if(error?.cause === -1) {
240
+ return;
241
+ }
242
+
238
243
  if(!document.hidden && shouldBeConnected && !isReconnecting) {
239
244
  this.__privates.iot.log('Keepalive failed:', error);
240
245
  this.iot.__updateCredentials();
@@ -311,19 +311,15 @@ class Iot {
311
311
  }
312
312
 
313
313
  if (this.subscribedTopics.size === 0) {
314
- reject(new Error('No subscribed topics available for connection check'));
314
+ reject(new Error('No subscribed topics available for connection check', {cause: -1}));
315
315
  return;
316
316
  }
317
317
 
318
318
  // Find a suitable topic for the connection check
319
319
  let suitableTopic = Array.from(this.subscribedTopics).find(topic => topic.indexOf('user') > -1);
320
320
 
321
- if(!suitableTopic) {
322
- suitableTopic = Array.from(this.subscribedTopics).find(topic => topic.indexOf('room') > -1 && topic !== 'wt/instanceroom/reactooDemo');
323
- }
324
-
325
321
  if (!suitableTopic) {
326
- reject(new Error('No suitable topic found for connection check'));
322
+ reject(new Error('No suitable topic found for connection check', {cause: -1}));
327
323
  return;
328
324
  }
329
325