@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.
@@ -5341,6 +5341,8 @@ class API {
5341
5341
  });
5342
5342
  const body = await response.json();
5343
5343
  this.#updateUrls(body);
5344
+ // Do not use the socket link from the config endpoint, as this is incomplete and will always fail if used
5345
+ delete this.URLS.socket;
5344
5346
  this.configReady = true;
5345
5347
  return body.config;
5346
5348
  } catch (error) {
@@ -5409,14 +5411,16 @@ class API {
5409
5411
  async connect() {
5410
5412
  this.connected = false;
5411
5413
  const conversationInitialState = await this.#createConversation();
5412
- this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
5413
- this.conversation.onConnection(({
5414
- connected,
5415
- ready
5416
- }) => {
5417
- this.connected = connected;
5418
- this.#ready = ready;
5419
- });
5414
+ if (this.URLS.socket) {
5415
+ this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
5416
+ this.conversation.onConnection(({
5417
+ connected,
5418
+ ready
5419
+ }) => {
5420
+ this.connected = connected;
5421
+ this.#ready = ready;
5422
+ });
5423
+ }
5420
5424
  return conversationInitialState;
5421
5425
  }
5422
5426
  uploadFile(file, progressCallback, successCallback, errorCallback) {
@@ -5577,7 +5581,7 @@ class API {
5577
5581
  return {
5578
5582
  clientName: "@seamly/web-ui",
5579
5583
  clientVariant: this.#layoutMode,
5580
- clientVersion: "23.0.5",
5584
+ clientVersion: "23.0.6-alpha.2",
5581
5585
  currentUrl: window.location.toString(),
5582
5586
  screenResolution: `${window.screen.width}x${window.screen.height}`,
5583
5587
  timezone: getTimeZone(),
@@ -22906,6 +22910,7 @@ class ExternalApi {
22906
22910
  constructor(appConfig) {
22907
22911
  this._waitingActions = [];
22908
22912
  this._instances = {};
22913
+ this.timeoutId = undefined;
22909
22914
  this.appConfig = appConfig;
22910
22915
  this.context = {};
22911
22916
  }
@@ -23015,7 +23020,10 @@ class ExternalApi {
23015
23020
  this._instances[config.namespace] = instance;
23016
23021
  // Clear the context after creating the instance, so we do not reuse it for the next
23017
23022
  this.context = {};
23018
- instance.render();
23023
+ window.clearTimeout(this.timeoutId);
23024
+ this.timeoutId = window.setTimeout(() => {
23025
+ instance.render();
23026
+ }, 60);
23019
23027
  }
23020
23028
  }
23021
23029
  handleDestroy(actionObj) {