@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.
@@ -5625,6 +5625,8 @@ class API {
5625
5625
  });
5626
5626
  const body = await response.json();
5627
5627
  this.#updateUrls(body);
5628
+ // Do not use the socket link from the config endpoint, as this is incomplete and will always fail if used
5629
+ delete this.URLS.socket;
5628
5630
  this.configReady = true;
5629
5631
  return body.config;
5630
5632
  } catch (error) {
@@ -5693,14 +5695,16 @@ class API {
5693
5695
  async connect() {
5694
5696
  this.connected = false;
5695
5697
  const conversationInitialState = await this.#createConversation();
5696
- this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
5697
- this.conversation.onConnection(({
5698
- connected,
5699
- ready
5700
- }) => {
5701
- this.connected = connected;
5702
- this.#ready = ready;
5703
- });
5698
+ if (this.URLS.socket) {
5699
+ this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
5700
+ this.conversation.onConnection(({
5701
+ connected,
5702
+ ready
5703
+ }) => {
5704
+ this.connected = connected;
5705
+ this.#ready = ready;
5706
+ });
5707
+ }
5704
5708
  return conversationInitialState;
5705
5709
  }
5706
5710
  uploadFile(file, progressCallback, successCallback, errorCallback) {
@@ -5861,7 +5865,7 @@ class API {
5861
5865
  return {
5862
5866
  clientName: "@seamly/web-ui",
5863
5867
  clientVariant: this.#layoutMode,
5864
- clientVersion: "23.0.6-alpha.1",
5868
+ clientVersion: "23.0.6-alpha.2",
5865
5869
  currentUrl: window.location.toString(),
5866
5870
  screenResolution: `${window.screen.width}x${window.screen.height}`,
5867
5871
  timezone: getTimeZone(),
@@ -23190,7 +23194,7 @@ class ExternalApi {
23190
23194
  constructor(appConfig) {
23191
23195
  this._waitingActions = [];
23192
23196
  this._instances = {};
23193
- this._timeoutId = undefined;
23197
+ this.timeoutId = undefined;
23194
23198
  this.appConfig = appConfig;
23195
23199
  this.context = {};
23196
23200
  }
@@ -23300,8 +23304,8 @@ class ExternalApi {
23300
23304
  this._instances[config.namespace] = instance;
23301
23305
  // Clear the context after creating the instance, so we do not reuse it for the next
23302
23306
  this.context = {};
23303
- window.clearTimeout(this._timeoutId);
23304
- this._timeoutId = window.setTimeout(() => {
23307
+ window.clearTimeout(this.timeoutId);
23308
+ this.timeoutId = window.setTimeout(() => {
23305
23309
  instance.render();
23306
23310
  }, 60);
23307
23311
  }