@enegelai/bot-widget 1.12.2 → 1.12.3
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/enegelaibot.umd.js +3 -3
- package/dist/index.es.js +9 -8
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -872,7 +872,8 @@ class L extends kt {
|
|
|
872
872
|
}
|
|
873
873
|
initConversation() {
|
|
874
874
|
const e = Date.now(), a = this.setting.newConversationTimeoutInSec * 1e3;
|
|
875
|
-
|
|
875
|
+
let n = this.lastConversationUpdate;
|
|
876
|
+
if (typeof n == "string" && (n = isNaN(n) ? 0 : parseInt(n, 10)), n > 0 && e - n > a) {
|
|
876
877
|
this.clearConversation();
|
|
877
878
|
return;
|
|
878
879
|
}
|
|
@@ -896,12 +897,12 @@ class L extends kt {
|
|
|
896
897
|
}
|
|
897
898
|
// Set data in the context of the conversation
|
|
898
899
|
async setContext(e) {
|
|
899
|
-
if (!
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
900
|
+
if (!e || typeof e != "object")
|
|
901
|
+
return;
|
|
902
|
+
const a = this.context ? this.context : {};
|
|
903
|
+
for (const [n, s] of Object.entries(e))
|
|
904
|
+
a[n] = s;
|
|
905
|
+
this.context = a, this.wsClient && await this.sendContext();
|
|
905
906
|
}
|
|
906
907
|
async sendContext() {
|
|
907
908
|
if (!this.context)
|
|
@@ -1477,7 +1478,7 @@ O([
|
|
|
1477
1478
|
], L.prototype, "setting");
|
|
1478
1479
|
O([
|
|
1479
1480
|
oe({ prefix: ee }),
|
|
1480
|
-
q({ type: Object, value:
|
|
1481
|
+
q({ type: Object, value: {} })
|
|
1481
1482
|
], L.prototype, "context");
|
|
1482
1483
|
O([
|
|
1483
1484
|
q({ type: String, value: "top-end" })
|