@hivegpt/hiveai-angular 0.0.607 → 0.0.608
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/esm2020/lib/components/chat-drawer/chat-drawer.component.mjs +7 -5
- package/fesm2015/hivegpt-hiveai-angular.mjs +7 -4
- package/fesm2015/hivegpt-hiveai-angular.mjs.map +1 -1
- package/fesm2020/hivegpt-hiveai-angular.mjs +6 -4
- package/fesm2020/hivegpt-hiveai-angular.mjs.map +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3674,10 +3674,12 @@ class ChatDrawerComponent {
|
|
|
3674
3674
|
}
|
|
3675
3675
|
this.cdr.detectChanges();
|
|
3676
3676
|
}
|
|
3677
|
-
scrollToBottom() {
|
|
3678
|
-
if (!this.autoScrollOnNewMessage) {
|
|
3677
|
+
scrollToBottom(force = false) {
|
|
3678
|
+
if (!force && !this.autoScrollOnNewMessage) {
|
|
3679
3679
|
return;
|
|
3680
3680
|
}
|
|
3681
|
+
if (!this.chatMain?.nativeElement)
|
|
3682
|
+
return;
|
|
3681
3683
|
let counter = 0;
|
|
3682
3684
|
const interval = setInterval(() => {
|
|
3683
3685
|
this.chatMain.nativeElement.scrollTop =
|
|
@@ -3688,7 +3690,7 @@ class ChatDrawerComponent {
|
|
|
3688
3690
|
}
|
|
3689
3691
|
/** Scrolls the chat container so the top of the AI message with the given id is visible. */
|
|
3690
3692
|
scrollToAiMessage(messageId) {
|
|
3691
|
-
if (!this.
|
|
3693
|
+
if (!this.chatMain?.nativeElement)
|
|
3692
3694
|
return;
|
|
3693
3695
|
const container = this.chatMain.nativeElement;
|
|
3694
3696
|
const el = container.querySelector(`[data-msg-id="${messageId}"]`);
|
|
@@ -4572,8 +4574,8 @@ class ChatDrawerComponent {
|
|
|
4572
4574
|
setTimeout(() => this.scrollToAiMessage(messageId), 30);
|
|
4573
4575
|
}
|
|
4574
4576
|
else {
|
|
4575
|
-
this.scrollToBottom();
|
|
4576
4577
|
this.cdr.markForCheck();
|
|
4578
|
+
setTimeout(() => this.scrollToBottom(true), 0);
|
|
4577
4579
|
}
|
|
4578
4580
|
break;
|
|
4579
4581
|
}
|