@enegelai/bot-widget 1.5.6 → 1.5.7

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/dist/index.es.js CHANGED
@@ -910,8 +910,6 @@ class W extends Ke {
910
910
  return this.messages.find((c) => c.author === "user") === void 0;
911
911
  }
912
912
  // Lazy initialization: avoid connecting until we actually need to send something
913
- // TODO Depending on state, start ws & connect immediately when initialized
914
- // use case: page refresh in the middle of the conversation
915
913
  async getWsClient() {
916
914
  if (this.wsClient)
917
915
  return this.wsClient;
@@ -923,7 +921,7 @@ class W extends Ke {
923
921
  convId: this.conversationId
924
922
  }), await this.wsClient.start(), this.wsClient.onMessage = (i) => {
925
923
  this.handleWscMessage(i);
926
- }, this.wsClient;
924
+ }, this.connectWs = "true", this.wsClient;
927
925
  }
928
926
  handleWscMessage(t) {
929
927
  var c;
@@ -939,7 +937,7 @@ class W extends Ke {
939
937
  text: t.text
940
938
  }
941
939
  };
942
- "userName" in t && (i.data.userName = t.userName, this.connectWs = "true"), "userAvatar" in t && (i.data.userAvatar = t.userAvatar, this.connectWs = "true");
940
+ "userName" in t && (i.data.userName = t.userName), "userAvatar" in t && (i.data.userAvatar = t.userAvatar);
943
941
  const n = this.formatMessage(i);
944
942
  this.messages = this.messages.concat([n]);
945
943
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enegelai/bot-widget",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Enegel.ai Bot Widget",
5
5
  "scripts": {
6
6
  "dev": "vite",