@hivegpt/hiveai-angular 0.0.291 → 0.0.292
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/bundles/hivegpt-hiveai-angular.umd.js +20 -13
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +10 -8
- package/esm2015/lib/components/conversation.service.js +12 -7
- package/fesm2015/hivegpt-hiveai-angular.js +20 -13
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/lib/components/conversation.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -532,13 +532,18 @@
|
|
|
532
532
|
};
|
|
533
533
|
ConversationService.prototype.getKey = function (botId, resetKey) {
|
|
534
534
|
if (resetKey === void 0) { resetKey = false; }
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
value
|
|
539
|
-
|
|
535
|
+
if (botId) {
|
|
536
|
+
var storageKey = "conversationKey_" + botId;
|
|
537
|
+
var value = localStorage.getItem(storageKey);
|
|
538
|
+
if (!value || resetKey) {
|
|
539
|
+
value = this.generateKey();
|
|
540
|
+
localStorage.setItem(storageKey, value);
|
|
541
|
+
}
|
|
542
|
+
return value;
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
return '';
|
|
540
546
|
}
|
|
541
|
-
return value;
|
|
542
547
|
};
|
|
543
548
|
ConversationService.prototype.sendValidatedUserData = function (message) {
|
|
544
549
|
//console.log('lgging messages', message, new Date());\
|
|
@@ -1005,13 +1010,15 @@
|
|
|
1005
1010
|
this.loading = true;
|
|
1006
1011
|
this.conversationKey = this.conversationService.getKey(this.botId, false);
|
|
1007
1012
|
console.log("fetchChatHistory log");
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
.
|
|
1014
|
-
|
|
1013
|
+
if (this.conversationKey != '') {
|
|
1014
|
+
var url = this.environment.BASE_URL + "/conversations/" + this.conversationKey;
|
|
1015
|
+
var headers = new http.HttpHeaders({
|
|
1016
|
+
accept: 'application/json',
|
|
1017
|
+
});
|
|
1018
|
+
return this.http
|
|
1019
|
+
.get(url, { headers: headers })
|
|
1020
|
+
.pipe(operators.catchError(this.handleError('fetchConversation')));
|
|
1021
|
+
}
|
|
1015
1022
|
};
|
|
1016
1023
|
ChatDrawerComponent.prototype.handleError = function (operation, result) {
|
|
1017
1024
|
if (operation === void 0) { operation = 'operation'; }
|