@reactoo/watchtogether-sdk-js 2.8.1 → 2.8.2

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.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Javascript SDK for Reactoo",
5
5
  "main": "dist/watchtogether-sdk.min.js",
6
6
  "module": "dist/watchtogether-sdk.min.js",
@@ -1041,7 +1041,7 @@ class RoomSession {
1041
1041
  this.#reconnect()
1042
1042
  .catch(e => {
1043
1043
  if(e.type !== 'warning') {
1044
- this.disconnect();
1044
+ this.disconnect().catch(() => {});
1045
1045
  }
1046
1046
  this.emit('error', e)
1047
1047
  });
@@ -1977,7 +1977,10 @@ class RoomSession {
1977
1977
  this.#wipeListeners();
1978
1978
 
1979
1979
  if(!this.useWebsockets) {
1980
- await this.#send({"janus": "destroy"}, true);
1980
+
1981
+ if(this.token) {
1982
+ await this.#send({"janus": "destroy"}, true);
1983
+ }
1981
1984
  }
1982
1985
 
1983
1986
  else if (this.ws && this.ws.readyState === 1) {
@@ -1986,7 +1989,18 @@ class RoomSession {
1986
1989
  }
1987
1990
 
1988
1991
  this.#subscriberJoinPromise = null;
1992
+
1989
1993
  this.sessionId = null;
1994
+ this.server = null;
1995
+ this.protocol = null;
1996
+ this.iceServers = null;
1997
+ this.token = null;
1998
+ this.roomId = null;
1999
+ this.pin = null;
2000
+ this.id = null;
2001
+ this.display = null;
2002
+ this.userId = null;
2003
+
1990
2004
  this.isPublished = false;
1991
2005
  this.isConnected = false;
1992
2006
  this.isDisconnecting = false;