@symbo.ls/socket 2.11.189 → 2.11.197

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.
Files changed (2) hide show
  1. package/client.js +6 -6
  2. package/package.json +2 -2
package/client.js CHANGED
@@ -11,6 +11,9 @@ const ENV = process.env.NODE_ENV
11
11
 
12
12
  const defautlOpts = {}
13
13
 
14
+ let CONNECT_ATTEPT = 0
15
+ const CONNECT_ATTEPT_MAX_ALLOWED = 1
16
+
14
17
  export const connect = (key, options = {}) => {
15
18
  const isDev = options.development ||
16
19
  (window && window.location && window.location.host.includes('local')) ||
@@ -28,7 +31,7 @@ export const connect = (key, options = {}) => {
28
31
  const secondaryUrl = socketUrls[1] || 'socket.symbols.app'
29
32
 
30
33
  const socket = io(primaryUrl || SOCKET_BACKEND_URL, {
31
- withCredentials: true
34
+ // withCredentials: true
32
35
  })
33
36
 
34
37
  socket.on('connect', () => {
@@ -52,19 +55,16 @@ export const connect = (key, options = {}) => {
52
55
  }
53
56
  })
54
57
 
55
- let CONNECT_ATTEPT = 0
56
- const CONNECT_ATTEPT_MAX_ALLOWED = 1
57
-
58
58
  socket.on('connect_error', (err) => {
59
59
  console.log(`event: connect_error | reason: ${err.message}`)
60
60
  try {
61
61
  if (isFunction(options.onError)) options.onError(err, socket)
62
62
 
63
63
  if (CONNECT_ATTEPT < CONNECT_ATTEPT_MAX_ALLOWED) {
64
- socket.disconnect()
65
-
66
64
  CONNECT_ATTEPT++
67
65
 
66
+ socket.disconnect()
67
+
68
68
  if (ENV === 'test' || ENV === 'development') {
69
69
  console.log(
70
70
  'Could not connect to %c' + primaryUrl + '%c, reconnecting to %c' + secondaryUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/socket",
3
- "version": "2.11.189",
3
+ "version": "2.11.197",
4
4
  "description": "Connect your app to Symbols editor",
5
5
  "main": "server.js",
6
6
  "author": "symbo.ls",
@@ -19,5 +19,5 @@
19
19
  "socket.io": "^4.5.2",
20
20
  "socket.io-client": "^4.5.2"
21
21
  },
22
- "gitHead": "a21f7711d88f65f16fb1e4c512649e4eec68d7de"
22
+ "gitHead": "5b2b1516c2cb42c2ee79892b4180bf5cf884fb90"
23
23
  }