Skip to content

Commit 4633cc0

Browse files
committed
fix(chat): Automatic scrolling to distinguish between PC and assistant
1 parent 8dd6cf8 commit 4633cc0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

frontend/src/views/chat/index.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ const scrollBottom = () => {
477477
}
478478
479479
const handleScroll = (val: any) => {
480+
if (!isCompletePage.value) return
480481
scrollTopVal = val.scrollTop
481482
scrolling = true
482483
clearTimeout(scrollingTime)
@@ -676,10 +677,12 @@ const sendMessage = async ($event: any = {}) => {
676677
677678
loading.value = true
678679
isTyping.value = true
679-
scrollTopVal = innerRef.value!.clientHeight
680-
scrollTime = setInterval(() => {
681-
scrollBottom()
682-
}, 300)
680+
if (isCompletePage.value) {
681+
scrollTopVal = innerRef.value!.clientHeight
682+
scrollTime = setInterval(() => {
683+
scrollBottom()
684+
}, 300)
685+
}
683686
await assistantPrepareSend()
684687
const currentRecord = new ChatRecord()
685688
currentRecord.create_time = new Date()

0 commit comments

Comments
 (0)