@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.
@@ -674,6 +674,8 @@ class API {
674
674
  });
675
675
  const body = await response.json();
676
676
  this.#updateUrls(body);
677
+ // Do not use the socket link from the config endpoint, as this is incomplete and will always fail if used
678
+ delete this.URLS.socket;
677
679
  this.configReady = true;
678
680
  return body.config;
679
681
  } catch (error) {
@@ -742,14 +744,16 @@ class API {
742
744
  async connect() {
743
745
  this.connected = false;
744
746
  const conversationInitialState = await this.#createConversation();
745
- this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
746
- this.conversation.onConnection(({
747
- connected,
748
- ready
749
- }) => {
750
- this.connected = connected;
751
- this.#ready = ready;
752
- });
747
+ if (this.URLS.socket) {
748
+ this.conversation.connect(`${this.#getUrlPrefix('ws')}${this.URLS.socket}`, this.#config.context.channelName, this.#getChannelTopic(), this.#getAccessToken());
749
+ this.conversation.onConnection(({
750
+ connected,
751
+ ready
752
+ }) => {
753
+ this.connected = connected;
754
+ this.#ready = ready;
755
+ });
756
+ }
753
757
  return conversationInitialState;
754
758
  }
755
759
  uploadFile(file, progressCallback, successCallback, errorCallback) {
@@ -910,7 +914,7 @@ class API {
910
914
  return {
911
915
  clientName: "@seamly/web-ui",
912
916
  clientVariant: this.#layoutMode,
913
- clientVersion: "23.0.6-alpha.1",
917
+ clientVersion: "23.0.6-alpha.2",
914
918
  currentUrl: window.location.toString(),
915
919
  screenResolution: `${window.screen.width}x${window.screen.height}`,
916
920
  timezone: getTimeZone(),
@@ -4818,7 +4822,7 @@ class ExternalApi {
4818
4822
  constructor(appConfig) {
4819
4823
  this._waitingActions = [];
4820
4824
  this._instances = {};
4821
- this._timeoutId = undefined;
4825
+ this.timeoutId = undefined;
4822
4826
  this.appConfig = appConfig;
4823
4827
  this.context = {};
4824
4828
  }
@@ -4928,8 +4932,8 @@ class ExternalApi {
4928
4932
  this._instances[config.namespace] = instance;
4929
4933
  // Clear the context after creating the instance, so we do not reuse it for the next
4930
4934
  this.context = {};
4931
- window.clearTimeout(this._timeoutId);
4932
- this._timeoutId = window.setTimeout(() => {
4935
+ window.clearTimeout(this.timeoutId);
4936
+ this.timeoutId = window.setTimeout(() => {
4933
4937
  instance.render();
4934
4938
  }, 60);
4935
4939
  }