@seamly/web-ui 23.0.5 → 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.
@@ -16174,6 +16174,8 @@ class API {
16174
16174
  });
16175
16175
  const body = await response.json();
16176
16176
  this.#updateUrls(body);
16177
+ // Do not use the socket link from the config endpoint, as this is incomplete and will always fail if used
16178
+ delete this.URLS.socket;
16177
16179
  this.configReady = true;
16178
16180
  return body.config;
16179
16181
  } catch (error) {
@@ -16242,14 +16244,16 @@ class API {
16242
16244
  async connect() {
16243
16245
  this.connected = false;
16244
16246
  const conversationInitialState = await this.#createConversation();
16245
- this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
16246
- this.conversation.onConnection(({
16247
- connected,
16248
- ready
16249
- }) => {
16250
- this.connected = connected;
16251
- this.#ready = ready;
16252
- });
16247
+ if (this.URLS.socket) {
16248
+ this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
16249
+ this.conversation.onConnection(({
16250
+ connected,
16251
+ ready
16252
+ }) => {
16253
+ this.connected = connected;
16254
+ this.#ready = ready;
16255
+ });
16256
+ }
16253
16257
  return conversationInitialState;
16254
16258
  }
16255
16259
  uploadFile(file, progressCallback, successCallback, errorCallback) {
@@ -16410,7 +16414,7 @@ class API {
16410
16414
  return {
16411
16415
  clientName: "@seamly/web-ui",
16412
16416
  clientVariant: this.#layoutMode,
16413
- clientVersion: "23.0.5",
16417
+ clientVersion: "23.0.6-alpha.2",
16414
16418
  currentUrl: window.location.toString(),
16415
16419
  screenResolution: `${window.screen.width}x${window.screen.height}`,
16416
16420
  timezone: getTimeZone(),
@@ -24262,6 +24266,7 @@ class ExternalApi {
24262
24266
  constructor(appConfig) {
24263
24267
  this._waitingActions = [];
24264
24268
  this._instances = {};
24269
+ this.timeoutId = undefined;
24265
24270
  this.appConfig = appConfig;
24266
24271
  this.context = {};
24267
24272
  }
@@ -24371,7 +24376,10 @@ class ExternalApi {
24371
24376
  this._instances[config.namespace] = instance;
24372
24377
  // Clear the context after creating the instance, so we do not reuse it for the next
24373
24378
  this.context = {};
24374
- instance.render();
24379
+ window.clearTimeout(this.timeoutId);
24380
+ this.timeoutId = window.setTimeout(() => {
24381
+ instance.render();
24382
+ }, 60);
24375
24383
  }
24376
24384
  }
24377
24385
  handleDestroy(actionObj) {