@seamly/web-ui 23.0.6-alpha.1 → 23.0.6-alpha.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": "@seamly/web-ui",
3
- "version": "23.0.6-alpha.1",
3
+ "version": "23.0.6-alpha.2",
4
4
  "main": "build/dist/lib/index.js",
5
5
  "types": "build/src/javascripts/index.d.ts",
6
6
  "exports": {
@@ -126,5 +126,6 @@
126
126
  "test:e2e": "playwright test",
127
127
  "test:e2e:coverage": "yarn nyc report --reporter cobertura --reporter html",
128
128
  "prepare": "husky install"
129
- }
129
+ },
130
+ "packageManager": "yarn@1.22.22"
130
131
  }
@@ -382,6 +382,8 @@ export class API {
382
382
  )
383
383
  const body = await response.json()
384
384
  this.#updateUrls(body)
385
+ // Do not use the socket link from the config endpoint, as this is incomplete and will always fail if used
386
+ delete this.URLS.socket
385
387
  this.configReady = true
386
388
  return body.config
387
389
  } catch (error: any) {
@@ -465,17 +467,19 @@ export class API {
465
467
  this.connected = false
466
468
  const conversationInitialState = await this.#createConversation()
467
469
 
468
- this.conversation.connect(
469
- `${this.#getUrlPrefix('ws')}${this.URLS.socket}`,
470
- this.#config.context.channelName,
471
- this.#getChannelTopic(),
472
- this.#getAccessToken(),
473
- )
470
+ if (this.URLS.socket) {
471
+ this.conversation.connect(
472
+ `${this.#getUrlPrefix('ws')}${this.URLS.socket}`,
473
+ this.#config.context.channelName,
474
+ this.#getChannelTopic(),
475
+ this.#getAccessToken(),
476
+ )
474
477
 
475
- this.conversation.onConnection(({ connected, ready }) => {
476
- this.connected = connected
477
- this.#ready = ready
478
- })
478
+ this.conversation.onConnection(({ connected, ready }) => {
479
+ this.connected = connected
480
+ this.#ready = ready
481
+ })
482
+ }
479
483
 
480
484
  return conversationInitialState
481
485
  }
@@ -12,7 +12,7 @@ class ExternalApi {
12
12
  constructor(appConfig) {
13
13
  this._waitingActions = []
14
14
  this._instances = {}
15
- this._timeoutId = undefined
15
+ this.timeoutId = undefined
16
16
  this.appConfig = appConfig
17
17
  this.context = {}
18
18
  }
@@ -124,8 +124,8 @@ class ExternalApi {
124
124
  this._instances[config.namespace] = instance
125
125
  // Clear the context after creating the instance, so we do not reuse it for the next
126
126
  this.context = {}
127
- window.clearTimeout(this._timeoutId)
128
- this._timeoutId = window.setTimeout(() => {
127
+ window.clearTimeout(this.timeoutId)
128
+ this.timeoutId = window.setTimeout(() => {
129
129
  instance.render()
130
130
  }, 60)
131
131
  }